vercel/next.js · critical
Fatal next config errors found in ${configFileName} that mus
Error message
Fatal next config errors found in ${configFileName} that must be fixed: What it means
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.
Source
Thrown at packages/next/src/server/config.ts:2586
for (const error of fatalErrors) {
errorMessages.push(` ${error.split('\n').join('\n ')}`)
}
errorMessages.push(
'These configuration options are required or have been migrated. Please update your configuration.'
)
errorMessages.push(
'See more info here: https://nextjs.org/docs/messages/invalid-next-config'
)
// Call the callback with validation messages if provided
if (onValidationMessages) {
onValidationMessages(errorMessages)
}
const fullErrorMessage = errorMessages.join('\n')
throw new Error(fullErrorMessage)
}
}
}
View on GitHub (pinned to 0ae8c72462)
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.
Example fix
// before (e.g. removed/renamed option)
module.exports = { someRemovedOption: true }
// after
module.exports = {} // remove the fatal option, or migrate to its replacement per the message Defensive patterns
Strategy: validation
Validate before calling
import { configSchema } from 'next/dist/server/config-schema';
const result = configSchema.safeParse(userConfig);
if (!result.success) {
for (const issue of result.error.issues) console.error(issue.path.join('.'), issue.message);
process.exit(1);
} Type guard
function passesConfigSchema(cfg: unknown): boolean {
return configSchema.safeParse(cfg).success;
} Prevention
- 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.
When it happens
Trigger: 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`.
Common situations: 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.
Related errors
- Specified basePath has to start with a /, found "${result.ba
- Server Actions Size Limit must be a valid number or filesize
- Config options `experimental.proxyClientMaxBodySize` and `ex
- Config options `experimental.proxyPrefetch` and `experimenta
- Config options `experimental.externalProxyRewritesResolve` a
AI-assisted analysis of vercel/next.js@0ae8c72462 (2026-08-06).
Data as JSON: /api/errors/e8962c1994edd66e.
Report an issue: GitHub.