Skip to content

Kompile Learn

Public source maps reveal your original code

Stop shipping .map files that let anyone rebuild your readable source code.

What it is

Build tools minify your JavaScript and can emit a source map next to it. A public source map turns the bundle back into your original files, comments included.

Why it matters

Attackers read source maps to find hidden API routes, admin-only screens, feature flags, and sometimes keys that were meant to stay on the server.

How to fix it

Next.js (next.config)

productionBrowserSourceMaps: false, // the default; make sure it was not turned on

Vite (vite.config)

build: { sourcemap: false }

Upload privately instead

Upload maps to your error tracker (Sentry, etc.) during the build, then delete the .map files before deploying.

Does your site have this problem?

Kompile Scan checks for this and the other problems in these guides in under a minute. Free for one site.

Check my site