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
6826f5ab
Unverified
Commit
6826f5ab
authored
Aug 25, 2026
by
Hendrik Liebau
Committed by
GitHub
Aug 25, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[test] Deflake the page config test for a string config value (#97848)
parent
76e24273
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
4 deletions
+27
-4
page-config.test.ts
test/production/page-config/page-config.test.ts
+27
-4
No files found.
test/production/page-config/page-config.test.ts
View file @
6826f5ab
import
{
nextTestSetup
}
from
'e2e-utils'
describe
(
'Page Config'
,
()
=>
{
const
{
next
}
=
nextTestSetup
({
const
{
next
,
isTurbopack
}
=
nextTestSetup
({
files
:
__dirname
,
skipStart
:
true
,
})
...
...
@@ -18,9 +18,32 @@ describe('Page Config', () => {
try
{
const
{
cliOutput
}
=
await
next
.
build
()
expect
(
cliOutput
).
toContain
(
"Next.js can't recognize the exported `config`"
)
// The two bundlers reject this config in different places, so each one
// reports a different error.
if
(
isTurbopack
)
{
// Turbopack rejects the config in its own transform, and the build
// stops there. It never reads the value with the segment config schema.
expect
(
cliOutput
).
toContain
(
"Next.js can't recognize the exported `config` field"
)
}
else
{
// Webpack reads the value with the segment config schema, and the
// schema rejects the string. The build stops with that error.
//
// `getPageStaticInfo` also warns that it cannot recognize the field.
// Only the server compilation logs that warning, and the build can stop
// before the server compilation reaches this page. The warning
// therefore does not always reach the output, and this test does not
// assert it. The tests below do, because the build does not stop for
// the configs they use.
expect
(
cliOutput
).
toContain
(
'Invalid segment configuration options detected for "/invalid/string-config"'
)
expect
(
cliOutput
).
toContain
(
'Expected object, received string at "config"'
)
}
}
finally
{
await
next
.
patchFile
(
'pages/invalid/string-config.js'
,
origContent
)
}
...
...
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