Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
createRedirectRenderResult fetch missing redirect: "manual" — causes errors and wasted latency on server action redirects | GoodFirstPicks

createRedirectRenderResult fetch missing redirect: "manual" — causes errors and wasted latency on server action redirects

vercel/next.js 1 comments 1mo ago
View on GitHub
lowopenScope: clearSkill match: yesNext.jsTypeScriptReact

Why this is a good first issue

A missing fetch option causes unnecessary server-side redirect handling.

AI Summary

The issue involves a missing `redirect: 'manual'` option in the `createRedirectRenderResult` function, which causes server-side redirect handling instead of delegating it to the client. The fix requires adding this option to the fetch call, similar to the `createForwardedActionResponse` function. The scope is clear, and the change is localized.

Issue Description

Link to the code that reproduces this issue

https://github.com/ajworkos/nextjs-redirect-bug-repro

To Reproduce

  1. Create a server action that calls redirect('/api/login') (or any internal route)
  2. The route handler at /api/login itself calls redirect('https://external-oauth-provider.com/authorize?...') — i.e., it redirects externally
  3. Wrap the server action in a client component <form action={...}> so it goes through the RSC action handler path
  4. Submit the form

Expected: The client receives the redirect and navigates to the external URL.

Actual (Demo 1 — error): If the external URL has a redirect chain (common with OAuth/SSO providers), the server-side fetch in createRedirectRenderResult follows all redirects and hits the "redirect count exceeded" limit, causing a 500 error.

Actual (Demo 2 — latency): Even when the chain is short enough to not error, the server unnecessarily fetches the external redirect target (e.g., a slow OAuth authorization page), adding seconds of wasted latency before the client gets the redirect response.

Current vs Expected behavior

Current: createRedirectRenderResult in packages/next/src/server/app-render/action-handler.ts makes a fetch() call without redirect: 'manual', causing it to automatically follow the entire redirect chain of the target URL server-side.

Expected: The fetch should use redirect: 'manual' (just like the sibling function createForwardedActionResponse already does), so the redirect is handed back to the client via the x-action-redirect header without following it server-side.

Root Cause

PR #65097 correctly added redirect: 'manual' to the createForwardedActionResponse function but missed applying the same fix to createRedirectRenderResult. The two functions serve similar roles (forwarding action responses), and the inconsistency means createRedirectRenderResult still follows redirects automatically.

The relevant code is at:

// create

GitHub Labels

Server Actions

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!

Risk Flags

  • potential impact on redirect behavior
Loading labels...

Details

Points10 pts
Difficultylow
Scopeclear
Skill Matchyes
Test Focusedno