Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
App Router: root generateMetadata reruns a shared fetch on sibling navigation even when the shared layout UI is preserved | GoodFirstPicks

App Router: root generateMetadata reruns a shared fetch on sibling navigation even when the shared layout UI is preserved

vercel/next.js 11 comments 16d ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeNext.jsTypeScriptReact

Why this is a good first issue

The issue involves understanding Next.js metadata and shared fetch behavior.

AI Summary

The issue describes a behavior where the root `generateMetadata()` re-evaluates during sibling navigation, triggering a shared fetch unnecessarily. The expected behavior is to reuse metadata if the shared layout segment is preserved. This requires understanding Next.js metadata handling and shared fetch behavior.

Issue Description

Link to the code that reproduces this issue

https://github.com/Innei/nextjs-generate-metadata-shared-fetch-repro

To Reproduce

  1. Clone the reproduction repo.
  2. Run npm install.
  3. Run npm run build && npm run start.
  4. Open http://localhost:3000/alpha.
  5. Note the latest server log for [shared-layout] fetch.
  6. Navigate to /beta using the in-app link.
  7. Observe that [shared-layout] fetch runs again.

Current vs. Expected behavior

Current:

  • The shared layout UI is preserved across sibling navigation.
  • The root generateMetadata() still re-evaluates during that navigation.
  • Because generateMetadata() uses the same shared fetch as the preserved layout, a new [shared-layout] fetch is triggered on the server.
  • The client navigation is an _rsc request and includes a refetch marker in next-router-state-tree.

Expected:

  • If a shared layout segment is preserved across sibling navigation, root metadata that only depends on that preserved segment could also be reused instead of triggering the shared fetch again.
  • If this reuse is intentionally not possible, the docs should state more clearly that preserved layouts do not imply preserved metadata evaluation or preserved shared data reads.

In short: the shared layout UI is preserved, but the shared server data read is not preserved once root generateMetadata() depends on it.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Wed Nov  5 21:33:59 PST 2025; root:xnu-11417.140.69.705.2~1/RELEASE_ARM64_T8112
  Available memory (MB): 24576
  Available CPU cores: 8
Binaries:
  Node: 22.21.0
  npm: 11.6.2
  Yarn: N/A
  pnpm: 10.26.2
Relevant Packages:
  next: 16.2.0-canary.99
  eslint-config-next: N/A
  react: 19.2.4
  react-dom: 19.2.4
  typescript: N/A
Next.js Config:
  output: N/A

Which area(s) are affected?

  • Linking and Navigating
  • Metadata

Which stage(s) are affected?

  • n

GitHub Labels

Linking and NavigatingMetadata

Want to work on this?

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

Risk Flags

  • requires understanding of Next.js internals
  • metadata handling
Loading labels...

Details

Points20 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedno