Unverified Commit 9b66a376 authored by Aurora Scharff's avatar Aurora Scharff Committed by GitHub

Improve error message for deprecated `experimental.dynamicIO` config (#92081)

### What?

Added a specific, actionable error message when users have
`experimental.dynamicIO` in their `next.config` file. Instead of the
generic "invalid experimental key" message, users now see that
`dynamicIO` has been replaced by `cacheComponents`, with a link to the
documentation.

### Why?

When `experimental.dynamicIO` was removed, users upgrading to newer
versions only saw a generic "Unrecognized key(s) in object: 'dynamicIO'"
warning without any guidance on what to use instead. This forces
developers to search through docs/changelogs to discover that
`cacheComponents` is the replacement. A clear migration message
eliminates this friction.

### How?

Added a case for `dynamicIO` in the `normalizeNextConfigZodErrors`
function in `packages/next/src/server/config.ts`, following the same
pattern used for `turbopackPersistentCaching` →
`turbopackFileSystemCache` migrations. When Zod reports `dynamicIO` as
an unrecognized key under `experimental`, the error is upgraded to a
fatal error with a message pointing to `cacheComponents` and linking to
the docs.

## PR checklist (Fixing a bug)

- Errors have a helpful link attached: links to
https://nextjs.org/docs/app/api-reference/config/next-config-js/cacheComponents
parent 4b62ff78
......@@ -84,6 +84,12 @@ function normalizeNextConfigZodErrors(
"\nUse 'experimental.turbopackFileSystemCacheForDev' instead."
message +=
'\nLearn more: https://nextjs.org/docs/app/api-reference/config/next-config-js/turbopackFileSystemCache'
} else if (message.includes('dynamicIO')) {
shouldExit = true
message +=
'\n`experimental.dynamicIO` has been replaced by `cacheComponents`. Please update your next.config file accordingly.'
message +=
'\nLearn more: https://nextjs.org/docs/app/api-reference/config/next-config-js/cacheComponents'
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment