RSC redirect returns raw 307 instead of 200 with flight redirect payload
#1 347 ouverte le 20 mai 2026
Métriques du dépôt
- Stars
- (8 563 étoiles)
- Métriques de merge PR
- (Merge moyen 1j 1h) (462 PRs mergées en 30 j)
Description
This issue was created by an agent analysing CI failures from the Next.js Deploy Suite (vinext
mainvs Next.jsv16.2.6, 2026-05-20).
Problem
When a server component calls redirect() and the request includes the Rsc header (indicating a client-side RSC navigation), Next.js responds with HTTP 200 and encodes the redirect instruction inside the RSC flight payload. vinext sends a raw HTTP 307 redirect, which breaks the client-side router since it expects a 200 with an RSC flight payload.
Similarly, when generateMetadata calls redirect(), the SSR response should still be 200 (metadata is suspended/streamed), not 307.
Expected: 200
Received: 307 // RSC request with Rsc header
Expected: 200
Received: 307 // redirect in generateMetadata
Estimated Impact
~3 test failures across the deploy suite.
Affected Test Suites
test/e2e/app-dir/rsc-redirect/rsc-redirect.test.ts(1 failure)test/e2e/app-dir/metadata-navigation/metadata-navigation.test.ts(2 failures)
Recommendation
-
Reproduce first in vinext's own test suite. Add a test with a server component that calls
redirect(), make a request with theRscheader, and assert the response is 200 with a flight redirect payload. Confirm it fails. -
Intercept
redirect()in the RSC entry. When rendering an RSC response andredirect()is called, catch the redirect and encode it as a flight redirect response (HTTP 200 with the redirect target in the RSC stream) instead of letting the raw 307 propagate. -
Study the Next.js flight redirect format. Search
.nextjs-ref/packages/next/src/server/for how redirects are serialized in RSC flight payloads.