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
7644b7e5
Unverified
Commit
7644b7e5
authored
Jun 03, 2026
by
Sebastian "Sebbie" Silbermann
Committed by
GitHub
Jun 03, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure aborting has the same inputs as render (#94436)
parent
c97ac7e5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
659 additions
and
193 deletions
+659
-193
app-render.tsx
packages/next/src/server/app-render/app-render.tsx
+50
-12
cache-components-errors.client.test.ts
...-components-errors/cache-components-errors.client.test.ts
+575
-0
cache-components-errors.test.ts
...r/cache-components-errors/cache-components-errors.test.ts
+0
-181
client.tsx
...s-errors/fixtures/client/app/client-awaited-io/client.tsx
+0
-0
page.tsx
...nts-errors/fixtures/client/app/client-awaited-io/page.tsx
+0
-0
client.tsx
...s/fixtures/client/app/client-use-pathname/[id]/client.tsx
+8
-0
page.tsx
...ors/fixtures/client/app/client-use-pathname/[id]/page.tsx
+5
-0
client.tsx
...s/fixtures/client/app/client-use-search-params/client.tsx
+8
-0
page.tsx
...ors/fixtures/client/app/client-use-search-params/page.tsx
+5
-0
layout.tsx
...ir/cache-components-errors/fixtures/client/app/layout.tsx
+0
-0
next.config.js
...ir/cache-components-errors/fixtures/client/next.config.js
+8
-0
No files found.
packages/next/src/server/app-render/app-render.tsx
View file @
7644b7e5
...
...
@@ -2032,7 +2032,10 @@ async function finalRuntimeServerPrerender(
// If the prerender is still pending then it must depend on dynamic data.
serverIsDynamic
=
true
}
finalServerController
.
abort
()
workUnitAsyncStorage
.
run
(
finalServerPrerenderStore
,
finalServerController
.
abort
.
bind
(
finalServerController
)
)
}
)
...
...
@@ -4834,7 +4837,10 @@ async function renderWithRestartOnCacheMissInDevWeb(
// This will be optimized in the future by not allowing runtime/dynamic APIs to resolve.
await cacheSignal.cacheReady()
initialReactController.abort()
workUnitAsyncStorage.run(
requestStore,
initialReactController.abort.bind(initialReactController)
)
//===============================================
// Final render (restarted)
...
...
@@ -5159,7 +5165,10 @@ async function renderWithRestartOnCacheMissInDevNode(
// This will be optimized in the future by not allowing runtime/dynamic APIs to resolve.
await cacheSignal.cacheReady()
initialReactController.abort()
workUnitAsyncStorage.run(
requestStore,
initialReactController.abort.bind(initialReactController)
)
//===============================================
// Final render (restarted)
...
...
@@ -5961,7 +5970,10 @@ async function warmupClientModulesForStagedValidation(
const cacheSignal = new CacheSignal()
trackPendingModules(cacheSignal)
await cacheSignal.cacheReady()
initialClientReactController.abort()
workUnitAsyncStorage.run(
initialClientPrerenderStore,
initialClientReactController.abort.bind(initialClientReactController)
)
}
async function validateStagedShell(
...
...
@@ -6089,7 +6101,10 @@ async function validateStagedShell(
return pendingFinalClientResult
},
() => {
clientReactController.abort()
workUnitAsyncStorage.run(
finalClientPrerenderStore,
clientReactController.abort.bind(clientReactController)
)
}
)
...
...
@@ -6373,7 +6388,10 @@ async function validateInstantConfigs(
return pendingResult
},
() => {
reactController.abort()
workUnitAsyncStorage.run(
prerenderStore,
reactController.abort.bind(reactController)
)
}
)
...
...
@@ -6658,7 +6676,10 @@ async function renderWithRestartOnCacheMissInValidation(
// Cache miss. Wait for caches to fill, then re-render with warm caches.
await
cacheSignal
.
cacheReady
()
initialReactController
.
abort
()
workUnitAsyncStorage
.
run
(
requestStore
,
initialReactController
.
abort
.
bind
(
initialReactController
)
)
//===============================================
// Final render (restarted, with warm caches)
...
...
@@ -7753,7 +7774,10 @@ async function prerenderToStream(
// Promises passed to client were already awaited above (assuming that they came from cached functions)
trackPendingModules
(
cacheSignal
)
await
cacheSignal
.
cacheReady
()
initialClientReactController
.
abort
()
workUnitAsyncStorage
.
run
(
initialClientPrerenderStore
,
initialClientReactController
.
abort
.
bind
(
initialClientReactController
)
)
}
const
finalServerReactController
=
new
AbortController
()
...
...
@@ -7924,7 +7948,10 @@ async function prerenderToStream(
serverIsDynamic
=
true
}
finalServerReactController
.
abort
()
workUnitAsyncStorage
.
run
(
finalServerPrerenderStore
,
finalServerReactController
.
abort
.
bind
(
finalServerReactController
)
)
}
)
...
...
@@ -8067,7 +8094,10 @@ async function prerenderToStream(
return
pendingFinalClientResult
},
()
=>
{
finalClientReactController
.
abort
()
workUnitAsyncStorage
.
run
(
finalClientPrerenderStore
,
finalClientReactController
.
abort
.
bind
(
finalClientReactController
)
)
}
)
...
...
@@ -8721,7 +8751,12 @@ async function prerenderToStream(
},
()
=>
{
if
(
!
errorServerReactController
.
signal
.
aborted
)
{
errorServerReactController
.
abort
()
workUnitAsyncStorage
.
run
(
errorPrerenderStore
,
errorServerReactController
.
abort
.
bind
(
errorServerReactController
)
)
}
}
)
...
...
@@ -8812,7 +8847,10 @@ async function prerenderToStream(
return
pendingErrorHtmlResult
},
()
=>
{
errorClientReactController
.
abort
()
workUnitAsyncStorage
.
run
(
errorClientPrerenderStore
,
errorClientReactController
.
abort
.
bind
(
errorClientReactController
)
)
}
)
...
...
test/e2e/app-dir/cache-components-errors/cache-components-errors.client.test.ts
0 → 100644
View file @
7644b7e5
This diff is collapsed.
Click to expand it.
test/e2e/app-dir/cache-components-errors/cache-components-errors.test.ts
View file @
7644b7e5
This diff is collapsed.
Click to expand it.
test/e2e/app-dir/cache-components-errors/fixtures/
defaul
t/app/client-awaited-io/client.tsx
→
test/e2e/app-dir/cache-components-errors/fixtures/
clien
t/app/client-awaited-io/client.tsx
View file @
7644b7e5
File moved
test/e2e/app-dir/cache-components-errors/fixtures/
defaul
t/app/client-awaited-io/page.tsx
→
test/e2e/app-dir/cache-components-errors/fixtures/
clien
t/app/client-awaited-io/page.tsx
View file @
7644b7e5
File moved
test/e2e/app-dir/cache-components-errors/fixtures/client/app/client-use-pathname/[id]/client.tsx
0 → 100644
View file @
7644b7e5
'use client'
import
{
usePathname
}
from
'next/navigation'
export
function
Client
()
{
usePathname
()
return
<
p
>
hello world
</
p
>
}
test/e2e/app-dir/cache-components-errors/fixtures/client/app/client-use-pathname/[id]/page.tsx
0 → 100644
View file @
7644b7e5
import
{
Client
}
from
'./client'
export
default
function
Page
()
{
return
<
Client
/>
}
test/e2e/app-dir/cache-components-errors/fixtures/client/app/client-use-search-params/client.tsx
0 → 100644
View file @
7644b7e5
'use client'
import
{
useSearchParams
}
from
'next/navigation'
export
function
Client
()
{
useSearchParams
()
return
<
p
>
hello world
</
p
>
}
test/e2e/app-dir/cache-components-errors/fixtures/client/app/client-use-search-params/page.tsx
0 → 100644
View file @
7644b7e5
import
{
Client
}
from
'./client'
export
default
function
Page
()
{
return
<
Client
/>
}
test/e2e/app-dir/cache-components-errors/fixtures/
default/app/client-awaited-io
/layout.tsx
→
test/e2e/app-dir/cache-components-errors/fixtures/
client/app
/layout.tsx
View file @
7644b7e5
File moved
test/e2e/app-dir/cache-components-errors/fixtures/client/next.config.js
0 → 100644
View file @
7644b7e5
/**
* @type {import('next').NextConfig}
*/
const
nextConfig
=
{
cacheComponents
:
true
,
}
module
.
exports
=
nextConfig
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