cloudflare/vinext

RSC redirect returns raw 307 instead of 200 with flight redirect payload

Fermée

#1 347 ouverte le 20 mai 2026

 (1 commentaire) (0 réaction) (0 personne assignée)TypeScript (371 forks)github user discovery
adapter-api-e2ehelp wanted

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 main vs Next.js v16.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

  1. Reproduce first in vinext's own test suite. Add a test with a server component that calls redirect(), make a request with the Rsc header, and assert the response is 200 with a flight redirect payload. Confirm it fails.

  2. Intercept redirect() in the RSC entry. When rendering an RSC response and redirect() 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.

  3. Study the Next.js flight redirect format. Search .nextjs-ref/packages/next/src/server/ for how redirects are serialized in RSC flight payloads.

Guide contributeur