The issue involves understanding Next.js metadata and shared fetch behavior.
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.
https://github.com/Innei/nextjs-generate-metadata-shared-fetch-repro
npm install.npm run build && npm run start.http://localhost:3000/alpha.[shared-layout] fetch./beta using the in-app link.[shared-layout] fetch runs again.Current:
generateMetadata() still re-evaluates during that navigation.generateMetadata() uses the same shared fetch as the preserved
layout, a new [shared-layout] fetch is triggered on the server._rsc request and includes a refetch marker
in next-router-state-tree.Expected:
In short: the shared layout UI is preserved, but the shared server data read is
not preserved once root generateMetadata() depends on it.
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
Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!