Last updated 26 November 2026. By Paul Badarau.
A fictional freelancer ships a booking site for a dental practice. The build writes app-5e2a.js and app-5e2a.js.map, and the bundle ends with //# sourceMappingURL=app-5e2a.js.map. Anyone can open that map from the live site and read the original code, comments included, because the map's sourcesContent field carries every source file.
Decide by what the code would reveal:
- Publish maps when the code is public already, such as an open-source project, and you want visitors' developer tools to show readable code.
- Keep them private when the code holds business rules, unreleased features, internal API paths or comments you would not post. Most client and commercial sites are in this group.
- Neither choice hides secrets. An API key in the bundle is readable in the minified file with or without a map, so keep secrets out of browser code.
To keep maps private and still read clear stack traces:
- Use your bundler's hidden source map setting, such as
build.sourcemap: 'hidden'in Vite ordevtool: 'hidden-source-map'in webpack. It writes the.mapfiles without the comment that points browsers at them. - Inject debug IDs and upload the maps to Monitoring with the Project's upload token.
- Delete the maps before the deploy step copies the output, for example with
find dist -name '*.map' -delete. - Request a
.mapaddress on the live site and confirm that it returns 404.
Monitoring removes sourcesContent before it stores a map and keeps only the mappings, file names and function names. It never serves a map over HTTP. It reads a map only to rewrite a stack frame when someone opens an issue, and it deletes the Workspace's maps when the Workspace's data is deleted.
Private maps still show names inside Monitoring. Everyone in the Workspace, Viewers included, sees your original file paths and function names in stack traces. A client you invite as a Viewer sees them too. Monitoring shows no source lines, because it never stores them, so you open the file in your editor to see the code around the error.
The product page for this is Monitoring.