{"record":{"id":"e8962c1994edd66e","repo":"vercel/next.js","slug":"fatal-next-config-errors-found-in-configfilename","errorCode":null,"errorMessage":"Fatal next config errors found in ${configFileName} that must be fixed:","messagePattern":"Fatal next config errors found in (.+?) that must be fixed:","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"packages/next/src/server/config.ts","lineNumber":2586,"sourceCode":"\n      for (const error of fatalErrors) {\n        errorMessages.push(`    ${error.split('\\n').join('\\n    ')}`)\n      }\n\n      errorMessages.push(\n        'These configuration options are required or have been migrated. Please update your configuration.'\n      )\n      errorMessages.push(\n        'See more info here: https://nextjs.org/docs/messages/invalid-next-config'\n      )\n\n      // Call the callback with validation messages if provided\n      if (onValidationMessages) {\n        onValidationMessages(errorMessages)\n      }\n\n      const fullErrorMessage = errorMessages.join('\\n')\n      throw new Error(fullErrorMessage)\n    }\n  }\n}\n","sourceCodeStart":2568,"sourceCodeEnd":2590,"githubUrl":"https://github.com/vercel/next.js/blob/0ae8c72462952df163f1b1e0726641bc5b40dc93/packages/next/src/server/config.ts#L2568-L2590","documentation":"The aggregate fatal-error throw at config.ts:2586. After Zod schema validation (`configSchema.safeParse`) of the user config, errors are split into warnings and fatal errors via `normalizeNextConfigZodErrors`. If any fatal errors remain, Next flushes telemetry and throws a combined message prefixed with 'Fatal next config errors found in <file>'. Warnings are printed but do not throw.","triggerScenarios":"Any config field that fails the Zod schema with fatal severity: unknown required-migrated keys, structurally invalid option shapes, options flagged as 'required or migrated'. The exact fatal set is determined by `normalizeNextConfigZodErrors`.","commonSituations":"Major version upgrades where config options were renamed/removed (the schema marks these fatal); typos in top-level keys that Zod rejects as unknown with fatal classification; mixing old and new option names.","solutions":["Read the listed fatal error paths in the message and fix each one in the named config file.","Follow the linked https://nextjs.org/docs/messages/invalid-next-config guidance for the specific options.","Run `npx @next/codemod` (or the current codemod tooling) to auto-migrate deprecated options after an upgrade.","Compare your config against the current default/example config to spot removed keys."],"exampleFix":"// before (e.g. removed/renamed option)\nmodule.exports = { someRemovedOption: true }\n// after\nmodule.exports = {} // remove the fatal option, or migrate to its replacement per the message","handlingStrategy":"validation","validationCode":"import { configSchema } from 'next/dist/server/config-schema';\nconst result = configSchema.safeParse(userConfig);\nif (!result.success) {\n  for (const issue of result.error.issues) console.error(issue.path.join('.'), issue.message);\n  process.exit(1);\n}","typeGuard":"function passesConfigSchema(cfg: unknown): boolean {\n  return configSchema.safeParse(cfg).success;\n}","tryCatchPattern":null,"preventionTips":["Run the schema pre-check in CI on PRs that touch the config.","Keep configs minimal and review against current docs after upgrades.","Use codemods to migrate deprecated options."],"tags":["config","schema","validation","migration"],"analyzedSha":"0ae8c72462952df163f1b1e0726641bc5b40dc93","analyzedAt":"2026-08-06T19:44:29.143Z","schemaVersion":2},"datasetVersion":"2026-08-07T02:17:10.218Z"}