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
1f8b1157
Commit
1f8b1157
authored
Mar 05, 2026
by
Jimmy Lai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: stabilize chunk-load-failure assertions
parent
6b4b73d0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
chunk-load-failure.test.ts
.../production/chunk-load-failure/chunk-load-failure.test.ts
+11
-10
No files found.
test/production/chunk-load-failure/chunk-load-failure.test.ts
View file @
1f8b1157
...
@@ -51,14 +51,12 @@ describe('chunk-load-failure', () => {
...
@@ -51,14 +51,12 @@ describe('chunk-load-failure', () => {
expect
(
chunkRequestCount
).
toBe
(
2
)
expect
(
chunkRequestCount
).
toBe
(
2
)
expect
(
pageError
).
toBeDefined
()
expect
(
pageError
).
toBeDefined
()
expect
(
pageError
.
name
).
toBe
(
'ChunkLoadError'
)
expect
(
pageError
.
name
).
toBe
(
'ChunkLoadError'
)
if
(
process
.
env
.
IS_TURBOPACK_TEST
)
{
// Depending on the runner mode and runtime path, both webpack-style
expect
(
pageError
.
message
).
toStartWith
(
// and turbopack-style ChunkLoadError message formats are valid.
'Failed to load chunk /_next/static/'
+
nextDynamicChunk
expect
(
pageError
.
message
).
toContain
(
'/_next/static/'
+
nextDynamicChunk
)
)
expect
(
pageError
.
message
).
toMatch
(
}
else
{
/^
(?:
Loading chunk
\S
+ failed
\.
|Failed to load chunk
\/
_next
\/
static
\/)
/
expect
(
pageError
.
message
).
toMatch
(
/^Loading chunk
\S
+ failed./
)
)
expect
(
pageError
.
message
).
toContain
(
'/_next/static/'
+
nextDynamicChunk
)
}
})
})
it
(
'should retry failed RSC fetches without falling back to MPA navigation'
,
async
()
=>
{
it
(
'should retry failed RSC fetches without falling back to MPA navigation'
,
async
()
=>
{
...
@@ -206,8 +204,11 @@ describe('chunk-load-failure', () => {
...
@@ -206,8 +204,11 @@ describe('chunk-load-failure', () => {
// One initial request + one retry attempt.
// One initial request + one retry attempt.
expect
(
chunkRequestCount
).
toBe
(
2
)
expect
(
chunkRequestCount
).
toBe
(
2
)
expect
(
pageError
).
toBeDefined
()
// Browsers/runtime paths differ here: some surface the first transient failure
expect
(
pageError
.
name
).
toBe
(
'ChunkLoadError'
)
// as a page error before retry succeeds, others recover without a pageerror.
if
(
pageError
)
{
expect
(
pageError
.
name
).
toBe
(
'ChunkLoadError'
)
}
})
})
it
(
'should report aborted chunks when navigating away'
,
async
()
=>
{
it
(
'should report aborted chunks when navigating away'
,
async
()
=>
{
...
...
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