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]| Argument | Description | Required | Repeatable |
|---|---|---|---|
| stack-trace-text | Stack trace text to decode. Used only when stdin is a terminal and --file is not given; --file and piped stdin take precedence. | no | no |
Options
| Flag | Alias | Value/type | Allowed values | Default | Required |
|---|---|---|---|---|---|
--file | -f | path (string) | — | — | no |
--build-dir | -b | dir (string) | — | — | no |
--sha | — | sha (string) | — | — | no |
--context | -c | lines (number) | — | 2 | no |
--format | — | type (string) | pretty, plain, json | pretty | no |
--json | — | boolean | — | — | no |
--stream | — | boolean | — | — | no |
--output | -o | path (string) | — | — | no |
--timeout | -t | ms (number) | — | 30000 | no |
--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.logExamples
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.txtSee also
Updated about 3 hours ago