Next.js 15: Invalid configuration option 'experimental.appDir'
Error: Invalid configuration option 'experimental.appDir' detected in next.config.js
This option is no longer supported. Please remove it from your configuration.
Immediate Remediation
bash
Remove the `experimental.appDir` key from your next.config.js file. In Next.js 15, the App Router is stable and does not require this flag. Simply delete the line or set it to false if you want to opt out.
Root Cause Analysis
Next.js 15 has stabilized the App Router, so the `experimental.appDir` flag is obsolete. Leaving it in the configuration triggers a validation error because Next.js now rejects unknown or deprecated experimental options to prevent misconfiguration.
Verification & Guardrails
- If you are upgrading from an older version, ensure you have removed all references to `experimental.appDir` from your config.
- Check for other deprecated experimental flags like `experimental.serverComponents` that may also need removal.
- After removing the flag, run `next build` to confirm the configuration is accepted.
Have a custom or uncategorized crash?
Run your trace through our in-memory client privacy sandbox for instant SRE remediation.