Skip to content

Prerender HTTP access fallbacks with Cache Components semantics#93988

Merged
unstubbable merged 1 commit into
canaryfrom
hl/not-found-prerender-cache-components
May 20, 2026
Merged

Prerender HTTP access fallbacks with Cache Components semantics#93988
unstubbable merged 1 commit into
canaryfrom
hl/not-found-prerender-cache-components

Conversation

@unstubbable
Copy link
Copy Markdown
Contributor

@unstubbable unstubbable commented May 20, 2026

The body of if (cacheComponents) in prerenderToStream is extracted into a local helper, prerenderWithCacheComponents(getPayload). The catch-block error paths now route through that helper whenever Cache Components is enabled, which means the legacy prerender-legacy store is no longer reachable from a Cache Components prerender.

As a result, notFound(), forbidden(), and unauthorized() recovery renders the matching fallback boundary under prerender and prerender-client semantics. Dynamic API access in those boundaries — for example useSearchParams() without a surrounding <Suspense> — now surfaces as a blocking-route error instead of the legacy BailoutToCSRError.

The dev side will be handled in a follow-up. The prerender handling diverged a bit from the dev rendering in #92231, and we'll likely need to re-align the dev rendering first.

Tip

Best reviewed with hidden whitespace changes.

Copy link
Copy Markdown
Contributor Author

unstubbable commented May 20, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

Tests Passed

Commit: a228fb3

@unstubbable unstubbable force-pushed the hl/not-found-cache-components-test branch from fe2b093 to c5f107f Compare May 20, 2026 21:22
@unstubbable unstubbable force-pushed the hl/not-found-prerender-cache-components branch 2 times, most recently from 2953ec5 to 0321455 Compare May 20, 2026 21:25
@unstubbable unstubbable marked this pull request as ready for review May 20, 2026 21:54
Base automatically changed from hl/not-found-cache-components-test to canary May 20, 2026 22:33
The body of `if (cacheComponents)` in `prerenderToStream` is extracted
into a local helper, `prerenderWithCacheComponents(getPayload)`. The
catch-block error paths now route through that helper whenever Cache
Components is enabled, which means the legacy `prerender-legacy` store
is no longer reachable from a Cache Components prerender.

As a result, `notFound()`, `forbidden()`, and `unauthorized()` recovery
renders the matching fallback boundary under `prerender` and
`prerender-client` semantics. Dynamic API access in those boundaries —
for example `useSearchParams()` without a surrounding `<Suspense>` — now
surfaces as a blocking-route error instead of the legacy
`BailoutToCSRError`.
@unstubbable unstubbable force-pushed the hl/not-found-prerender-cache-components branch from 0321455 to a228fb3 Compare May 20, 2026 22:35
@unstubbable unstubbable enabled auto-merge (squash) May 20, 2026 22:36
@unstubbable unstubbable merged commit 5b6747a into canary May 20, 2026
164 of 165 checks passed
@unstubbable unstubbable deleted the hl/not-found-prerender-cache-components branch May 20, 2026 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants