rk decode-stack

Summary

Decode a Hermes / JS stack trace to TypeScript source positions.

Description

Run from your app root directory (the folder containing roku-config.ts); it automatically locates the most recent dist-dev/bundle or dist-build/bundle directory and picks the right source maps. With no stack-trace text and no --file, it reads the trace from stdin: paste it and press Ctrl+D, or pipe a log in.

Usage

rk decode-stack [options] [stack-trace-text]
ArgumentDescriptionRequiredRepeatable
stack-trace-textStack trace text to decode. Used only when stdin is a terminal and --file is not given; --file and piped stdin take precedence.nono

Options

FlagAliasValue/typeAllowed valuesDefaultRequired
--file-fpath (string)——no
--build-dir-bdir (string)——no
--sha—sha (string)——no
--context-clines (number)—2no
--format—type (string)pretty, plain, jsonprettyno
--json—boolean——no
--stream—boolean——no
--output-opath (string)——no
--timeout-tms (number)—30000no
--dcl-dir—lib=dir (string)——no

--file

Read stack trace from file (cannot combine with --stream)

--build-dir

Bundle directory containing source maps

--sha

Source-map SHA to locate build artifacts (auto-detected in batch mode)

--context

Lines of source context

--format

Output format

--json

Output as JSON (shorthand for --format json)

--stream

Process stdin line-by-line for live log streams

--output

Write decoded output to a file (implies --format plain unless overridden)

--timeout

Stdin read timeout in milliseconds

Example:

pbpaste | rk decode-stack --timeout 5000

--dcl-dir

Build directory of a Dynamic Component Library, so its frames resolve too (repeat once per library)

Example:

rk decode-stack --dcl-dir mylib=../mylib/dist-build --dcl-dir ui=../ui/dist-build -f crash.log

Examples

rk decode-stack --file crash.log
rk decode-stack --build-dir dist-build/bundle --context 5
rk decode-stack --build-dir /archive/builds --sha 4a7f3c8e -f crash.log
rk decode-stack --dcl-dir mylib=../mylib/dist-build -f crash.log
rk decode-stack --format plain --file error.log
rk decode-stack --file crash.log --output decoded.txt

See also


Did this page help you?