next.js
c06658e9 - fix: preserve HTTP access fallbacks during prerender recovery (#92231)

Commit
50 days ago
fix: preserve HTTP access fallbacks during prerender recovery (#92231) When a `notFound()`, `forbidden()`, or `unauthorized()` error escapes into the outer prerender recovery path, we were falling back to the generic error shell flow. In the `cacheComponents` case, that could leave us with: - error HTML rendered from `ErrorApp` - Flight data reused from the aborted prerender prelude - references to Flight chunks that were never emitted That is what caused the client-side `Connection closed` failure in #86251. Instead of rerendering the full Flight tree or always using the generic error RSC payload, this change: - finds the deepest matching HTTP fallback boundary - rerenders the normal app router payload with that segment-scoped fallback - tees the replacement Flight stream so Fizz can render from one copy while prerender buffering consumes the other - only takes this path for recoverable HTTP access fallbacks that have a real boundary (ie a defined not-found/unauthorized/etc) If no matching boundary exists, we keep the existing generic error handling. Fixes #86251 Fixes #90837 Closes #87041 Closes #86251 Closes NAR-711 Closes NEXT-4876
Author
Parents
Loading