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.jsReact Server ComponentsTurbopackServer ActionsAffected 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

Agent Frameworks

LangChain, LlamaIndex, and Pydantic

  1. highProperty graph relation keys collide when entity IDs or labels contain underscores
  2. highCodeActAgent drops assistant tool-call metadata during handoff, leaving an orphan tool response
  3. high[Bug]: HierarchicalNodeParser async methods return the documents unsplit
  4. highLLM.predict_and_call fails with ValidationError for non-function-calling models when react_chat_formatter is omitted
  5. highAnthropic streaming server-tool input_json_delta overwrites completed client tool_use arguments due to stale cur_tool_call state