vercel / vercel/next.js

Calling redirect from a React Server Component to an intercepted route causes infinite rerendering loop

Open
#75,762 5 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

linear: next Parallel & Intercepting Routes Redirects
Dominant language
JavaScript
Stars
142k
Forks
32.4k
Avg merge
2d 14h
Merged PRs (30d)
351

Description

Link to the code that reproduces this issue

https://github.com/denexapp/redirect-from-rsc-to-intercepted-route-bug

To Reproduce
  1. Start the dev server
  2. Open the main page and click on the Link
  3. Wait for 30 seconds
  4. Watch the terminal and the browser console for a list of errors / rerender messages
Current vs. Expected behavior

Expected behaviour:

A component from the intercepted route renders once

  1. Current behaviour:

Component gets rerendered in a loop

  1. Navigation works incorrectly, causing weird errors and sometimes crashing the app
Provide environment information
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:06:57 PDT 2024; root:xnu-11215.41.3~3/RELEASE_ARM64_T6041
  Available memory (MB): 36864
  Available CPU cores: 14
Binaries:
  Node: 22.9.0
  npm: 10.8.3
  Yarn: N/A
  pnpm: 9.12.1
Relevant Packages:
  next: 15.1.6 // Latest available version is detected (15.1.6).
  eslint-config-next: 15.1.2
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.7.3
Next.js Config:
  output: N/A
Which area(s) are affected? (Select all that apply)

Redirects

Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local), next start (local), Other (Deployed), Vercel (Deployed)

Additional context

Original issue https://github.com/vercel/next.js/issues/61341

Recreating it as it's a critical problem that makes redirect function very dangerous to use in Next 15.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked reproduction repository and follow its redirect from the React Server Component to the intercepted route while running the dev server. Compare the behavior with original issue #61341; done means the intercepted component renders once, navigation completes, and the terminal and browser show no rerender loop or related errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nextjs, react
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.