Start a project

Tool 121 of 194 · JavaScript

Minified Stack Trace Resolver

Turn a minified JavaScript stack trace into the original file names, line numbers and function names, with the code around each frame, using your own source maps.

Minified Stack Trace Resolver at a glanceIllustration: 1, A minified trace; 2, processed in your browser; 3, Original lines.Minified Stack Trace Resolver1A minified trace3Original lines2In yourbrowser
1 A minified trace 2 processed on your device 3 Original lines

Minified Stack Trace Resolver

Stack trace

Source maps

MapFor fileSourcesWith code

Resolved trace

Original stack trace
#Minified frameOriginal positionFunctionStatus

    Code at each frame

    01

    What it does

    Maps each frame of a minified stack trace back to the original file, line, column and function name with your source maps, and shows the code.

    • Chrome, Edge, Node, Firefox and Safari trace formats
    • Frames matched to maps by file name or the map's file field
    • Binary search in the decoded mappings for each position
    • Original function names recovered from the map

    02

    Private by design

    Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

    03

    What you get

    A resolved trace, a frame table and code context, with a Copy and a Download button on every result.

    • JavaScript
    • Source maps
    • Debugging
    • Stack trace

    Why it matters

    Errors from production arrive as minified stack traces: a function called a, line 1, column 48213. Error trackers can resolve them if you upload your source maps to them, but sometimes all you have is a trace from a log or a user's screenshot, and maps you'd rather not upload anywhere.

    This resolver parses the trace in any of the three browser engines' formats, matches each frame's file to a map you drop in, finds the exact mapping for its line and column, and prints the original position, with the enclosing function's real name taken from the map's names. If the map has sourcesContent you also see the code with the failing column marked. Frames from third-party scripts, eval code or a different build are explained rather than silently skipped. Nothing leaves your browser.

    How it works

    1. InputA stack trace and your source maps
    2. In your browserEach frame looked up in the decoded mappings
    3. OutputOriginal files, lines, names and code

    Where it fits in a designer's workflow

    1. Plan
    2. Design
    3. Build
    4. Test
    5. Launch
    Debugging errors reported from production.

    By the numbers

    Frames in the sample trace, by resultResolved: 2 frames; No map for this file: 1 frameResolved2 framesNo map for this file1 frame
    Resolved by this tool with its sample map: the minified functions a and d come back as addToBasket and onBuyClick, at the original line and column. The third frame is a third-party script with no published map, which is the usual reason a frame stays minified. Source: ECMA-426 source map format; V8 stack trace API.
    Show the numbers as a table
    #Minified frameOriginal positionFunctionStatus
    1a · app.3f2a9c.js:5:92src/basket.js:6:3addToBasketResolved
    2HTMLButtonElement.d · app.3f2a9c.js:4:172src/checkout/form.js:7:7onBuyClickResolved
    3HTMLButtonElement.wrapped · monitor.js:1:2040No map for this file

    How to use it

    1. Paste the stack trace.
    2. Drop the .map files for the scripts in it.
    3. Read the resolved trace and the code at each frame.
    4. Copy the original trace into your bug report.

    FAQ

    Why does a frame say 'No map for this file'?

    No loaded map matches its file name. Third-party scripts rarely publish maps; for your own, drop the .map from the same build.

    Why are the lines slightly off?

    Usually the map is from a different build than the code that threw. File names with content hashes (app.3f2a9c.js) help make sure they match.

    Where do the function names come from?

    From the map's names array: the nearest named mapping before the position, in the same original file. If the map has no names, the minified name from the trace is kept.

    Which trace formats does it read?

    V8 (Chrome, Edge, Node: "at fn (file:line:col)"), SpiderMonkey (Firefox: "fn@file:line:col") and JavaScriptCore (Safari), including async and eval frames.

    Are my maps uploaded?

    No. They're read in your browser and forgotten when you close the page.

    Work with me

    Want a site that gets these right?

    I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

    All developer tools · Back to leej.uk