Skip to content

no-production-browser-source-maps

Next.js production browser source maps expose application source

Why

Next.js production browser source maps publish original client source and implementation details to every browser that can load the deployment.

Fix

Leave productionBrowserSourceMaps disabled and upload private source maps directly to the error-monitoring service during the build.

Examples

Before — flagged Do not publish production browser source maps
next.config.mjs
export default { productionBrowserSourceMaps: true };
After — preferred Keep browser source maps private
next.config.mjs
export default { productionBrowserSourceMaps: false };