Unverified Commit 186e25f7 authored by Shu Ding's avatar Shu Ding Committed by GitHub

Add warning for experimental flags that have moved (#44202)

These options have been moved out of `experimental`.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
parent e847b496
...@@ -615,6 +615,42 @@ function assignDefaults(dir: string, userConfig: { [key: string]: any }) { ...@@ -615,6 +615,42 @@ function assignDefaults(dir: string, userConfig: { [key: string]: any }) {
result.transpilePackages = (result.experimental as any).transpilePackages result.transpilePackages = (result.experimental as any).transpilePackages
} }
if (
result.experimental &&
'allowMiddlewareResponseBody' in (result.experimental as any)
) {
Log.warn(
`\`allowMiddlewareResponseBody\` has been moved out of \`experimental\`. Please update your ${configFileName} file accordingly.`
)
result.allowMiddlewareResponseBody = (
result.experimental as any
).allowMiddlewareResponseBody
}
if (
result.experimental &&
'skipMiddlewareUrlNormalize' in (result.experimental as any)
) {
Log.warn(
`\`skipMiddlewareUrlNormalize\` has been moved out of \`experimental\`. Please update your ${configFileName} file accordingly.`
)
result.skipMiddlewareUrlNormalize = (
result.experimental as any
).skipMiddlewareUrlNormalize
}
if (
result.experimental &&
'skipTrailingSlashRedirect' in (result.experimental as any)
) {
Log.warn(
`\`skipTrailingSlashRedirect\` has been moved out of \`experimental\`. Please update your ${configFileName} file accordingly.`
)
result.skipTrailingSlashRedirect = (
result.experimental as any
).skipTrailingSlashRedirect
}
if ( if (
result.experimental?.outputFileTracingRoot && result.experimental?.outputFileTracingRoot &&
!isAbsolute(result.experimental.outputFileTracingRoot) !isAbsolute(result.experimental.outputFileTracingRoot)
......
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