Debug production JavaScript with source maps
8 steps · about 2 h 55 min · Intermediate
- Map generated code back to source (guide, MDN Web Docs, 20 min)
See how a debugger resolves minified locations into readable files and lines.
- Connect a resource to its map (reference, MDN Web Docs, 12 min)
Learn the response header that can identify a source map without an inline comment.
- Understand source-map contents and tradeoffs (guide, web.dev, 30 min)
Relate mappings, source files and names to debugging value and exposure risk.
- Inspect mapped code in Chrome DevTools (guide, Chrome for Developers, 25 min)
Confirm that breakpoints and stack traces resolve against the intended source version.
- Remove framework noise from call stacks (guide, Chrome for Developers, 18 min)
Ignore known third-party scripts so the relevant application frames remain visible.
- Choose a webpack map mode deliberately (reference, webpack documentation, 25 min)
Balance rebuild speed, mapping quality and whether source content appears in deployed artifacts.
- Generate linked or external maps with esbuild (reference, esbuild documentation, 20 min)
Apply the same deployment decision in a second common build tool.
- Verify release and artifact matching (guide, Sentry documentation, 25 min)
Finish by checking the frequent causes of unmapped production stack traces.