srcmap-symbolicate
Stack trace symbolication using source maps.
Parses stack traces from V8 (Chrome, Node.js), SpiderMonkey (Firefox), and JavaScriptCore (Safari), resolves each frame through source maps, and produces readable output. Built for error monitoring, crash reporting, and debugging services.
Usage
use ;
use SourceMap;
let stack = "Error: oops\n at foo (bundle.js:10:5)\n at bar (bundle.js:20:10)";
// Parse without symbolication
let frames = parse_stack_trace;
assert_eq!;
assert_eq!;
// Symbolicate with a source map loader
let result = symbolicate;
println!; // Pretty-printed symbolicated stack
API
| Function | Description |
|---|---|
parse_stack_trace(input) |
Parse into Vec<StackFrame> |
parse_stack_trace_full(input) |
Parse into ParsedStack (message + frames) |
symbolicate(stack, loader) |
Parse and resolve through source maps |
symbolicate_batch(stacks, maps) |
Batch symbolication with pre-loaded maps |
resolve_by_debug_id(id, maps) |
Find a source map by its ECMA-426 debug ID |
to_json(stack) |
Serialize a SymbolicatedStack to JSON |
Supported stack trace formats
| Engine | Example format |
|---|---|
| V8 (Chrome, Node.js) | at functionName (file:line:column) |
| SpiderMonkey (Firefox) | functionName@file:line:column |
| JavaScriptCore (Safari) | functionName@file:line:column |
Part of srcmap
See the main repo for the full source map SDK.
License
MIT