My source maps are public. Does it matter?
A public .js.map file lets anyone download your original source, comments and all. It's not a key leak, but it makes every other mistake easier to find.
How to fix it
- Vite: set
build: { sourcemap: false }invite.config, so the maps are never built. Use'hidden'instead only if your error tracker needs the maps. It drops the comment that points to them but still builds the files, so you must also do step 3. - Next.js: leave
productionBrowserSourceMapsunset orfalseinnext.config. - If you use Sentry or another error tracker, upload the maps to it during the build and delete the
.mapfiles from the deployed output. This is required if you chose'hidden', because anyone can guess a.mapaddress. - Redeploy, then scan again. The scan only finds maps that a script points to, so it can't see hidden ones. If you used
'hidden', also openhttps://<your-site>/assets/<chunk>.js.mapfor one of your script files and check that it returns 404.
Common questions
Do source maps slow my site?
No. Browsers only fetch them when dev tools are open. The cost is exposure, not speed.
Is 'hidden' safe?
Only partly. It drops the comment that points to your maps, but the .map files are still built and anyone who guesses their address can download them. Delete them from the deployed output and check that one returns 404, because the scan can't see hidden maps.
Why does the grade drop to C?
Public source is a real exposure, so it caps the grade at C until it's fixed.
Fixed it? Scan again to confirm.
Scan your app for leaks