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

  1. Read the listed fatal error paths in the message and fix each one in the named config file.
  2. Follow the linked https://nextjs.org/docs/messages/invalid-next-config guidance for the specific options.
  3. Run `npx @next/codemod` (or the current codemod tooling) to auto-migrate deprecated options after an upgrade.
  4. 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

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


AI-assisted analysis of vercel/next.js@0ae8c72462 (2026-08-06). Data as JSON: /api/errors/e8962c1994edd66e. Report an issue: GitHub.