Skip to content
Fallow home
All docs pages

Docs home

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

ArgumentDescription
[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:

FieldContent
kind"trace-error"
schema_versionThe version of this output format.
sourcestdin, or the path as you gave it.
headerThe first line before the frames, for example the error message. Absent when the input starts with a frame.
framesOne 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.
countsTotals: frames, frames_omitted, one count for each origin and each resolution, and unparsed_lines.
reasonOne summary sentence.
  • file is the path as the trace gives it, without a file:// or http(s):// prefix. For a URL frame, file is the URL path: Fallow drops the host, the query and the fragment, and decodes percent escapes. So a development server frame such as http://localhost:5173/src/a.ts?t=1 matches src/a.ts in 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 as class-method), and line and member when they apply. candidates.len() + candidates_omitted is the number of matches.
  • counts.frames is the number of frames in the report. resolved + ambiguous + not_found + not_attempted gives that number, and so does in_project + node_modules + out_of_corpus. Add frames_omitted for 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_found on an in-project frame 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

CodeMeaning
0The run completed. Unresolved frames do not change the code.
2Invalid 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
  • 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_error tool runs this command.