Decode a minified stack trace with a source map
A source map maps each line and column of minified JavaScript back to the original file. Give this tool the .map file and the stack trace and it rewrites every frame to the original source location.
[LOCAL] Runs in your browser. Your files stay on your device and nothing is uploaded.
Or drop the file here, or paste the JSON below.
[OK] Example map (app.min.js): 2 sources, 1 lines
Decoded stack trace
TypeError: Cannot read properties of undefined (reading 'card')
at t (src/cart.ts:4:5)
at src/checkout.ts:5:10
at https://example.com/assets/vendor.min.js:2:41202 of 3 frames decoded (1 skipped: other file, 0 with no mapping)
Original source around each frame
src/cart.ts:4:5
2 let sum = 0;3 for (const i of items) {4 sum += i.price * i.qty;5 }6 return sum;
src/checkout.ts:5:10
3 export function pay(order) {4 const amount = total(order.items);5 return charge(order.customer.card, amount);6 }7
Supported stack trace formats
Chrome, Edge, Node: at render (https://example.com/app.min.js:1:4021) Chrome, anonymous: at https://example.com/app.min.js:1:4021 Firefox, Safari: render@https://example.com/app.min.js:1:4021
Index maps with a sections array are supported, and so is a sourceRoot prefix.
How to use it
- Pick the .map file that was built with the same bundle that threw the error. It sits next to the minified file, for example app.min.js.map.
- Paste the minified stack trace from the browser console, a bug report or your logs. Chrome, Edge, Node, Firefox and Safari formats all work.
- Read the decoded trace below the inputs. Every frame from the matching file now shows the original source file, line and column.
- Open the source excerpts to see the lines of code around each frame, when the map includes sourcesContent.
- Copy the result or download it as a text file to paste into an issue.
Questions
- Where do I get the .map file?
- Your bundler writes it when source maps are on: devtool "source-map" in webpack, build.sourcemap in Vite, sourcemap: true in esbuild and Rollup, productionBrowserSourceMaps in Next.js. It has the same name as the bundle with .map added.
- Why does a frame stay minified?
- Either its file is not the one the map was built for, or the map has no mapping at that position. Tick the option to decode every frame if the file names differ, for example when the bundle is served from a CDN path.
- Does the map have to match the exact build?
- Yes. A map from a different build gives wrong lines. Keep the map for every release you ship, and match it by build hash or release version.
- Are line and column numbers 0-based or 1-based?
- Stack traces count lines and columns from 1. The mappings inside the source map count from 0. This tool converts for you, so you can paste frames as they are.
- Is my source map uploaded anywhere?
- No. The file is read and decoded by JavaScript in this tab. Nothing is sent to a server, and closing the tab discards it.