nextjs - 💡(How to fix) Fix updateTag does not invalidate prefetched RSC payloads when returning via prefetched Link

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/spatulatom/prefetch-revalidation

To Reproduce

  1. Clone the repro repo: git clone https://github.com/spatulatom/prefetch-revalidation.git
  2. Install dependencies: npm install
  3. Build production bundle: npm run build
  4. Start production server: npm run start
  5. Open http://localhost:3000
  6. Wait for top nav to show Home and default prefetch
  7. Create an item, open it, and add one comment
  8. Click the top-nav Home link
  9. Observe list row can show 0 comments until hard refresh

Current vs. Expected behavior

Current behavior:

  • On Next.js 16.2.4 with default Home prefetch, navigation back to / can render stale prefetched list payload after a comment mutation and updateTag("items").
  • The row can show 0 comments immediately after navigation, then become correct after hard reload.

Expected behavior:

  • After updateTag("items"), the next navigation should render fresh data immediately.
  • Returning via the Home link should show 1 comment without needing a hard reload.

Provide environment information

Operating System:

  • Platform: win32
  • Arch: x64
  • Version: Windows 11 Home

Binaries:

  • Node: 24.13.0
  • npm: 11.8.0

Relevant Packages:

  • next: 16.2.4 (repro pinned)
  • react: 19.2.4
  • react-dom: 19.2.4
  • typescript: 5.9.3

Version matrix from local production runs of this reduced repro:

  • 16.2.4 + default prefetch: stale reproduced
  • 16.2.4 + prefetch={false} (Home link): fresh
  • 16.2.6 + default prefetch: fresh in this reduced repro

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

Cache, Linking and Navigating, Server Actions, Use Cache

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

next build (local), next start (local)

Additional context

  • Reproduces in production mode only (next build + next start).
  • This reduced repro uses one route flow; the only switch is Home prefetch mode via NEXT_PUBLIC_DISABLE_HOME_PREFETCH=1.
  • Shared root layout includes a Suspense fallback Home link and a resolved Home link from a suspending Server Component.
  • Live deployment: https://prefetch-revalidation.vercel.app/

Implementation details in the repro repo:

  • app/layout.tsx shared suspending nav + fallback
  • app/page.tsx cached list route with cacheTag("items")
  • app/[id]/actions.ts comment mutation + updateTag("items")

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING