Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
a5317ed6
Unverified
Commit
a5317ed6
authored
Aug 12, 2025
by
Jiachi Liu
Committed by
GitHub
Aug 12, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: amp deprecation warning should assert on user config (#82572)
parent
756221bb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
20 deletions
+24
-20
config.ts
packages/next/src/server/config.ts
+20
-20
types.ts
packages/next/src/types.ts
+4
-0
No files found.
packages/next/src/server/config.ts
View file @
a5317ed6
...
...
@@ -161,6 +161,26 @@ function assignDefaults(
delete
userConfig
.
exportTrailingSlash
}
// There are a good amount of test fixtures that have amp enabled
// that also assert on stderr output being empty, so we're gating the
// warning to be skipped when running in Next.js tests until we fully
// remove the feature.
if
(
!
process
.
env
.
__NEXT_TEST_MODE
)
{
warnOptionHasBeenDeprecated
(
userConfig
,
'amp'
,
`Built-in amp support is deprecated and the \`amp\` configuration option will be removed in Next.js 16.`
,
silent
)
warnOptionHasBeenDeprecated
(
userConfig
,
'experimental.amp'
,
`Built-in amp support is deprecated and the \`experimental.amp\` configuration option will be removed in Next.js 16.`
,
silent
)
}
// Handle deprecation of experimental.dynamicIO and migrate to experimental.cacheComponents
if
(
userConfig
.
experimental
?.
dynamicIO
!==
undefined
)
{
warnOptionHasBeenDeprecated
(
...
...
@@ -503,26 +523,6 @@ function assignDefaults(
}
}
// There are a good amount of test fixtures that have amp enabled
// that also assert on stderr output being empty, so we're gating the
// warning to be skipped when running in Next.js tests until we fully
// remove the feature.
if
(
!
process
.
env
.
__NEXT_TEST_MODE
)
{
warnOptionHasBeenDeprecated
(
result
,
'amp'
,
`Built-in amp support is deprecated and the \`amp\` configuration option will be removed in Next.js 16.`
,
silent
)
warnOptionHasBeenDeprecated
(
result
,
'experimental.amp'
,
`Built-in amp support is deprecated and the \`experimental.amp\` configuration option will be removed in Next.js 16.`
,
silent
)
}
warnCustomizedOption
(
result
,
'experimental.esmExternals'
,
...
...
packages/next/src/types.ts
View file @
a5317ed6
...
...
@@ -114,6 +114,10 @@ export type ResponseLimit = SizeLimit | boolean
* `Config` type, use it for export const config
*/
export
type
PageConfig
=
{
/**
* @deprecated built-in amp support will be removed in Next 16
* @see [`next/amp`](https://nextjs.org/docs/api-reference/next/amp)
*/
amp
?:
boolean
|
'hybrid'
api
?:
{
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment