mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #764] Handle HTTP access fallback boundaries (notFound/forbidden/unauthorized) during prerender recovery #168
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#168
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @github-actions[bot] on GitHub (Apr 3, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/764
Upstream change
Next.js PR #92231 (commit
c06658e) fixes hownotFound(),forbidden(), andunauthorized()errors are handled when they escape into the outer prerender recovery path.Previously, when these errors escaped during prerendering (especially with
cacheComponents), Next.js fell back to the generic error shell flow. This caused:ErrorAppinstead of the correct fallback componentConnection closedfailuresWhat changed
The fix introduces boundary-aware recovery for HTTP access errors during prerender:
findPrerenderHTTPErrorBoundaryTree— walks the loader tree to find the deepest segment that has a matching fallback boundary (not-found.tsx,forbidden.tsx,unauthorized.tsx)Key files changed:
packages/next/src/server/app-render/app-render.tsx— prerender recovery path now checks for HTTP fallback boundariespackages/next/src/server/app-render/create-component-tree.tsx— newPrerenderHTTPErrorStatetype, renders fallback element directly at the boundary segment instead of descending into the throwing subtreeRelevance to vinext
vinext implements its own App Router prerender/SSR path in
entries/app-rsc-entry.tsandserver/modules. WhennotFound(),forbidden(), orunauthorized()is thrown during rendering, vinext needs to:Without this fix, apps using
notFound()inside layouts with Suspense boundaries may see client-side hydration errors orConnection closedfailures.Fixes upstream: vercel/next.js#86251, vercel/next.js#90837