{"record":{"id":"6d90f5a5d5beed67","repo":"vercel/next.js","slug":"the-experimental-allowdevelopmentbuild-option-requ","errorCode":null,"errorMessage":"The experimental.allowDevelopmentBuild option requires NODE_ENV to be explicitly set to 'development'.","messagePattern":"The experimental\\.allowDevelopmentBuild option requires NODE_ENV to be explicitly set to 'development'\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/next/src/server/config.ts","lineNumber":495,"sourceCode":"      const level =\n        typeof expConfig === 'object' && expConfig !== null\n          ? (expConfig.level ?? true)\n          : expConfig\n      // Map 'verbose' to true since browserToTerminal doesn't support 'verbose'\n      const normalizedValue = level === 'verbose' ? true : level\n\n      result.logging = {\n        ...loggingConfig,\n        browserToTerminal: normalizedValue,\n      }\n    }\n  }\n\n  if (\n    result.experimental?.allowDevelopmentBuild &&\n    process.env.NODE_ENV !== 'development'\n  ) {\n    throw new Error(\n      `The experimental.allowDevelopmentBuild option requires NODE_ENV to be explicitly set to 'development'.`\n    )\n  }\n\n  // Validate sassOptions.functions is not used with Turbopack\n  if (\n    process.env.TURBOPACK &&\n    result.sassOptions &&\n    'functions' in result.sassOptions\n  ) {\n    throw new Error(\n      `The \"sassOptions.functions\" option is not supported when using Turbopack. ` +\n        `Custom Sass functions are only available with webpack. ` +\n        `Please remove the \"functions\" property from your sassOptions in ${configFileName}.`\n    )\n  }\n\n  // Validate experimental.cssChunking compatibility with the active bundler. Graph mode is","sourceCodeStart":477,"sourceCodeEnd":513,"githubUrl":"https://github.com/vercel/next.js/blob/0ae8c72462952df163f1b1e0726641bc5b40dc93/packages/next/src/server/config.ts#L477-L513","documentation":"The `experimental.allowDevelopmentBuild` flag permits running a development build outside of the normal dev server, but it only makes sense when `NODE_ENV` is explicitly 'development'. Config normalization throws if the flag is set and `process.env.NODE_ENV` is anything else (production, undefined, test). This prevents accidental dev-bundle code from shipping in production contexts.","triggerScenarios":"Setting `experimental: { allowDevelopmentBuild: true }` while NODE_ENV is 'production', 'test', or unset. Common when running a build script that doesn't set NODE_ENV.","commonSituations":"Enabling allowDevelopmentBuild in a shared config but running `next build` without NODE_ENV=development. CI pipelines that don't export NODE_ENV. Using a process manager that strips env.","solutions":["Set NODE_ENV=development explicitly before running the dev build command: `NODE_ENV=development next dev`","Remove the allowDevelopmentBuild flag if you don't actually need a development build"],"exampleFix":"// before\n// next.config.js\nmodule.exports = { experimental: { allowDevelopmentBuild: true } }\n// run: next dev  (NODE_ENV unset)\n// after\nNODE_ENV=development next dev","handlingStrategy":"validation","validationCode":"if (config.experimental?.allowDevelopmentBuild && process.env.NODE_ENV !== 'development') {\n  throw new Error('Set NODE_ENV=development before enabling allowDevelopmentBuild')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set NODE_ENV=development in the script that runs the dev build","Don't enable allowDevelopmentBuild in config shared with production builds"],"tags":["config","experimental","environment","node-env"],"analyzedSha":"0ae8c72462952df163f1b1e0726641bc5b40dc93","analyzedAt":"2026-08-06T19:44:29.143Z","schemaVersion":2},"datasetVersion":"2026-08-07T02:17:10.218Z"}