AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

Duplicate Metadata Tags After Soft Navigation On Vercel With Next.Js 16.3

After a client-side soft navigation on a Vercel deployment, the previous route's metadata tags (og:*, twitter:*, description) remain in <head> alongside the new route's tags, causing duplicate social preview tags. Server-rendered HTML and hard reloads are correct; only prefetched soft navigations are affected.

highConfidence 72%Next.jsAffected V16.3.0Affected V16.3.1

Origin Analysis

Next.js 16.3 client-side router fails to remove the previous route's metadata from <head> during soft navigation when the destination route is served as a Vercel PRERENDER prefetch payload. The head reconciliation logic appears to merge rather than replace existing metadata, causing duplicate og/twitter/description tags.
1. Deploy the reproduction app to Vercel. 2. Immediately after the deployment is READY, open / in a browser. 3. Click 'Article one' (client-side navigation; link prefetches). 4. Run in devtools: [...document.head.querySelectorAll('meta[property="og:type"]')].map(m => m.content) 5. Observe duplicate values ['website', 'article'].

Fixing Code Block

Edge Case Audit

This is a temporary workaround, not an official fix. It may remove metadata tags that were manually injected outside Next.js control, and it can race with React's async head updates if new metadata arrives after the effect runs. To rollback, simply remove the component from the layout; the app will not break further, but the original duplicate metadata issue will reappear.

Ecosystem Topology