Calling redirect from a React Server Component to an intercepted route causes infinite rerendering loop
Nobody has claimed this yet.
- 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
- Start the dev server
- Open the main page and click on the Link
- Wait for 30 seconds
- 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
- Current behaviour:
Component gets rerendered in a loop
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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