fallow trace-error
fallow trace-error maps the frames of a runtime stack trace to the definitions in your project.
Map the frames of a runtime stack trace to the definitions in your project.
For a walk from a finding to its cause, read Trace a finding.
Synopsis
fallow trace-error [OPTIONS] [FILE]
Options
| Argument | Description |
|---|---|
[FILE] | Stack trace file, or - to read stdin. Defaults to stdin. |
This command has no options of its own.
The global options are in these groups: Project, Output, Scope, Baselines, Gates, Duplication, Type-aware, Performance.
Fallow reads V8, Node.js, SpiderMonkey and JavaScriptCore traces. It does not read source maps, so a frame in generated build output stays unresolved. The input limit is 1 MiB. A report holds at most 256 frames and 10 candidate definitions for each frame, and counts what it leaves out.
Output
fallow trace-error crash.txt
Stack-trace frames (syntactic; OFF the ranked path)
source: crash.txt
error: TypeError: boom
[0] createOrder src/services/orders.ts:12 [in-project/resolved]
-> src/services/orders.ts:11 createOrder (export)
[1] Object.<anonymous> src/index.ts:11 [in-project/not-attempted]
'Object.<anonymous>' is not an addressable identifier
[2] run node_modules/zod/lib/index.js:10 [node-modules/not-attempted]
frame is in an installed dependency, not in project source
frames 3 | resolved 1 | ambiguous 0 | not found 0 | not attempted 2
Each frame shows its origin and its resolution as a pair in brackets. The origin is in-project, node-modules or out-of-corpus (a file outside the analyzed project). The resolution is resolved, ambiguous (more than one definition matches), not-found or not-attempted. The indented line gives the matched definition or the reason.
With --format json, the output has these top-level fields:
| Field | Content |
|---|---|
kind | "trace-error" |
schema_version | The version of this output format. |
source | stdin, or the path as you gave it. |
header | The first line before the frames, for example the error message. Absent when the input starts with a frame. |
frames | One object for each frame, in input order: index, raw, function, file, line, column, origin, resolution, candidates, candidates_omitted, reason. is_constructor: true and is_async: true mark a new frame and an async frame. A resolved frame also has line_mismatch: true when another definition of the same file is declared closer above the line of the frame. The runtime can then have run another definition with the same name. |
counts | Totals: frames, frames_omitted, one count for each origin and each resolution, and unparsed_lines. |
reason | One summary sentence. |
fileis the path as the trace gives it, without afile://orhttp(s)://prefix. For a URL frame,fileis the URL path: Fallow drops the host, the query and the fragment, and decodes percent escapes. So a development server frame such ashttp://localhost:5173/src/a.ts?t=1matchessrc/a.tsin the project. Fallow does not change it to the path of the module that it matched.- Each candidate has
file,symbol,kind(export, or a member kind such asclass-method), andlineandmemberwhen they apply.candidates.len() + candidates_omittedis the number of matches. counts.framesis the number of frames in the report.resolved + ambiguous + not_found + not_attemptedgives that number, and so doesin_project + node_modules + out_of_corpus. Addframes_omittedfor the number of frames in the input.- When fallow reads no frame in the input, the report has zero frames and a value above 0 in
unparsed_lines. So you can tell such an input from an empty trace. not_foundon anin-projectframe means that no export or member has the name of the frame. The function can be local to its module, or the runtime can give it another name.
The JSON output reference has each field.
Exit codes
| Code | Meaning |
|---|---|
0 | The run completed. Unresolved frames do not change the code. |
2 | Invalid input, for example a file that does not exist or an input over 1 MiB. |
See Exit codes.
Examples
# Map the frames of a saved trace
fallow trace-error crash.txt
# Read the trace from stdin
pbpaste | fallow trace-error -
# Get the result as JSON for a script
fallow trace-error crash.txt --format json --quiet
Related
fallow trace: the callers of a symbol and the import path between modules.fallow inspect: one bundle of evidence for a file or a symbol.- MCP server: the
trace_errortool runs this command.