How to fix: Next.js Development Build Running in Production
The response contains Next.js development-mode build artifacts ('development-mode _next/static paths' paths or a 'development' buildId), indicating the app is running 'next dev' instead of a production build.
Why it matters
Dev-mode Next.js ships unminified source, verbose error overlays with stack traces and source snippets, and disables several production hardening defaults, all reachable by anyone who can reach the URL.
'next dev' is meant for local development only: it compiles on demand, keeps source maps and readable module names in the client bundle, and renders full error overlays instead of generic error pages. Running it as the production server (instead of 'next build' + 'next start') leaks internal implementation detail with every request.
How to fix it
- 1Run 'next build' followed by 'next start' (or deploy the standalone output) instead of 'next dev' in any publicly reachable environment.
- 2Verify NODE_ENV=production is set for the running process.
- 3Confirm the deployment platform is not accidentally invoking the dev script from package.json.
Code examples
Correct production start command
npm run build
npm run start
# package.json: "start": "next start", never "next dev" in productionReferences
Detected automatically by VulnRadar. The check id is nextjs-dev-mode-exposed, stable across every scan so you can filter or diff on it.
More config checks
- MediumNo Rate-Limit Policy Detected
- MediumVary: Cookie Missing on Cookie-Bearing Response
- LowSet-Cookie Header Exceeds 4 KB
- LowVary Header Missing on Compressed Responses
- InfoDownloadable Content Served as inline
- InfoX-XSS-Protection Header Is Deprecated
- LowServer-Timing Exposes Cache Timings
- LowVary: Cookie on Static Resource
Questions
- How severe is Next.js Development Build Running in Production?
- VulnRadar rates this medium severity in the config category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
- Does VulnRadar check for this automatically?
- Yes. It runs as part of every scan under the check id nextjs-dev-mode-exposed, which stays the same between runs so you can filter, diff, or gate CI on it.
- Which standards does Next.js Development Build Running in Production map to?
- It maps to CWE-489. In the OWASP Top 10 it falls under A05:2021.
Missing a check?
The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.