Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
[Bug] RSC re-fetches permanently stop when <Link> prefetches a proxy-rewritten route that adds hidden search params | GoodFirstPicks

[Bug] RSC re-fetches permanently stop when <Link> prefetches a proxy-rewritten route that adds hidden search params

vercel/next.js 3 comments 1mo ago
View on GitHub
highopenScope: somewhat clearSkill match: maybeTest focusedNext.jsTypeScriptReact

Why this is a good first issue

The issue involves a cache key mismatch in RSC prefetch mechanism with proxy-rewritten routes.

AI Summary

The issue is a cache key mismatch in the RSC prefetch mechanism when using proxy-rewritten routes. The prefetch caches the response under the visible URL, but the proxy adds hidden search params, causing the cache key to not match the actual fetch. This requires understanding of both the RSC prefetch mechanism and proxy behavior.

Issue Description

Link to the code that reproduces this issue

https://github.com/VeiaG/nextjs-proxy-rewrite-prefetch-rsc-bug-

To Reproduce

Clone reproduction repo

Important: must be tested with a production build. Does not reproduce in dev mode.

pnpm install
pnpm run deploy

The header has two links:

  • Blue — /test — public URL that is rewritten by the proxy (buggy path)
  • Green — /dynamicPages/filtered — direct URL, no rewrite (works correctly, for comparison)

Confirming the direct route works (baseline)

  1. Click the green /dynamicPages/filtered link
  2. Click + to set page=2 → Server searchParams updates ✅
  3. Click reset → Server searchParams updates back to default ✅
  4. Click + again → updates ✅ — everything works normally

Reproducing the bug on the rewritten route

The root condition: RSC re-fetches only work on /test when the page was loaded with at least one search param already in the URL. The moment the URL has no params — either because you loaded that way or navigated there — RSC re-fetches stop entirely.

Simplest reproduction:

  1. Navigate directly to /test (no params)
  2. Click + or any filter → URL updates but Server searchParams does not change ❌

Illustrated with contrast:

  1. Navigate directly to /test?page=2 (server renders with params)
  2. Click + → page goes to 3, Server searchParams updates ✅ — works because page loaded with params
  3. Click reset → URL becomes /test (no params), Server shows page=1 (default)
  4. Click + → URL becomes /test?page=2 but Server searchParams does not update ❌
  5. Click any filter → Server searchParams does not update ❌

Open the Network tab: no _rsc requests are sent in steps 4–5.

Minimal reproduction code

src/proxy.ts — adds testParam=testValue to every rewrite of /test:

export const proxy = (request: NextRequest) => {
    if (request.nextUrl.pathname === '/test') {
        const url = new

GitHub Labels

MiddlewareLinking and Navigating

Want to work on this?

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

Risk Flags

  • requires understanding of RSC prefetch mechanism
  • proxy behavior adds complexity
Loading labels...

Details

Points30 pts
Difficultyhigh
Scopesomewhat clear
Skill Matchmaybe
Test Focusedyes