cloudflare/vinext

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

クローズ

#1,347 opened on 2026/05/20

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)TypeScript (384 件のフォーク)github user discovery
adapter-api-e2ehelp wanted

Repository metrics

Stars
 (8,625 個のスター)
PR merge metrics
 (平均マージ 1d 1h) (30d で 462 merged PRs)

説明

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.

コントリビューターガイド