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
e9205bf2
Unverified
Commit
e9205bf2
authored
Nov 04, 2025
by
Hendrik Liebau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use static stage end time for static shell validation
parent
df76b85a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
8 deletions
+16
-8
app-render.tsx
packages/next/src/server/app-render/app-render.tsx
+9
-8
staged-rendering.ts
packages/next/src/server/app-render/staged-rendering.ts
+6
-0
page.tsx
...ponents-errors/fixtures/default/app/dynamic-root/page.tsx
+1
-0
No files found.
packages/next/src/server/app-render/app-render.tsx
View file @
e9205bf2
...
...
@@ -828,6 +828,7 @@ async function generateDynamicFlightRenderResultWithStagesInDev(
dynamicChunks
,
staticInterruptReason
,
runtimeInterruptReason
,
staticStageEndTime
,
runtimeStageEndTime
,
debugChannel
:
returnedDebugChannel
,
requestStore
:
finalRequestStore
,
...
...
@@ -855,6 +856,7 @@ async function generateDynamicFlightRenderResultWithStagesInDev(
dynamicChunks
,
staticInterruptReason
,
runtimeInterruptReason
,
staticStageEndTime
,
runtimeStageEndTime
,
ctx
,
clientReferenceManifest
,
...
...
@@ -2582,6 +2584,7 @@ async function renderToStream(
dynamicChunks
,
staticInterruptReason
,
runtimeInterruptReason
,
staticStageEndTime
,
runtimeStageEndTime
,
debugChannel
:
returnedDebugChannel
,
requestStore
:
finalRequestStore
,
...
...
@@ -2609,6 +2612,7 @@ async function renderToStream(
dynamicChunks
,
staticInterruptReason
,
runtimeInterruptReason
,
staticStageEndTime
,
runtimeStageEndTime
,
ctx
,
clientReferenceManifest
,
...
...
@@ -3202,6 +3206,7 @@ async function renderWithRestartOnCacheMissInDev(
staticInterruptReason
:
initialStageController
.
getStaticInterruptReason
(),
runtimeInterruptReason
:
initialStageController
.
getRuntimeInterruptReason
(),
staticStageEndTime
:
initialStageController
.
getStaticStageEndTime
(),
runtimeStageEndTime
:
initialStageController
.
getRuntimeStageEndTime
(),
debugChannel
,
requestStore
,
...
...
@@ -3319,6 +3324,7 @@ async function renderWithRestartOnCacheMissInDev(
dynamicChunks
,
staticInterruptReason
:
finalStageController
.
getStaticInterruptReason
(),
runtimeInterruptReason
:
finalStageController
.
getRuntimeInterruptReason
(),
staticStageEndTime
:
initialStageController
.
getStaticStageEndTime
(),
runtimeStageEndTime
:
initialStageController
.
getRuntimeStageEndTime
(),
debugChannel
,
requestStore
,
...
...
@@ -3478,6 +3484,7 @@ async function spawnStaticShellValidationInDev(
dynamicServerChunks
:
Array
<
Uint8Array
>
,
staticInterruptReason
:
Error
|
null
,
runtimeInterruptReason
:
Error
|
null
,
staticStageEndTime
:
number
,
runtimeStageEndTime
:
number
,
ctx
:
AppRenderContext
,
clientReferenceManifest
:
NonNullable
<
RenderOpts
[
'clientReferenceManifest'
]
>
,
...
...
@@ -3557,17 +3564,11 @@ async function spawnStaticShellValidationInDev(
debugChannelClient
.
on
(
'data'
,
(
c
)
=>
debugChunks
.
push
(
c
))
}
// For both runtime and static validation we use the same end time which is
// when the runtime stage ended. This ensures that any I/O that is awaited
// (start of the await) in the dynamic stage won't be considered by React when
// constructing the owner stacks that we use for the validation errors.
const
debugEndTime
=
runtimeStageEndTime
const
runtimeResult
=
await
validateStagedShell
(
runtimeServerChunks
,
dynamicServerChunks
,
debugChunks
,
debug
EndTime
,
runtimeStage
EndTime
,
rootParams
,
fallbackRouteParams
,
allowEmptyStaticShell
,
...
...
@@ -3590,7 +3591,7 @@ async function spawnStaticShellValidationInDev(
staticServerChunks
,
dynamicServerChunks
,
debugChunks
,
debug
EndTime
,
staticStage
EndTime
,
rootParams
,
fallbackRouteParams
,
allowEmptyStaticShell
,
...
...
packages/next/src/server/app-render/staged-rendering.ts
View file @
e9205bf2
...
...
@@ -15,6 +15,7 @@ export class StagedRenderingController {
naturalStage
:
RenderStage
=
RenderStage
.
Static
staticInterruptReason
:
Error
|
null
=
null
runtimeInterruptReason
:
Error
|
null
=
null
staticStageEndTime
:
number
=
Infinity
runtimeStageEndTime
:
number
=
Infinity
/** Whether sync IO should interrupt the render */
enableSyncInterrupt
=
true
...
...
@@ -130,6 +131,10 @@ export class StagedRenderingController {
return
this
.
runtimeInterruptReason
}
getStaticStageEndTime
()
{
return
this
.
staticStageEndTime
}
getRuntimeStageEndTime
()
{
return
this
.
runtimeStageEndTime
}
...
...
@@ -185,6 +190,7 @@ export class StagedRenderingController {
this
.
currentStage
=
stage
if
(
currentStage
<
RenderStage
.
Runtime
&&
stage
>=
RenderStage
.
Runtime
)
{
this
.
staticStageEndTime
=
performance
.
now
()
+
performance
.
timeOrigin
const
runtimeListeners
=
this
.
runtimeStageListeners
for
(
let
i
=
0
;
i
<
runtimeListeners
.
length
;
i
++
)
{
runtimeListeners
[
i
]()
...
...
test/e2e/app-dir/cache-components-errors/fixtures/default/app/dynamic-root/page.tsx
View file @
e9205bf2
...
...
@@ -64,6 +64,7 @@ const fetchRandom = async (entropy: string) => {
'https://next-data-api-endpoint.vercel.app/api/random?b='
+
entropy
)
// The error should point at the fetch above, and not at the following fetch.
// FIXME: On the first load after starting the dev server that doesn't work.
await
fetch
(
'https://next-data-api-endpoint.vercel.app/api/random?b='
+
entropy
+
'x'
)
...
...
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