You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inconsistent hydration: some tags in the head are duplicated, eg. application/ld+json #6569
I'm seeing this exact same behavior in React Router v7, and looking at the source here in TanStack Router, it seems to share the same root cause.
In packages/router/src/HeadContent.tsx (specifically around the Script or Meta component rendering logic), the framework uses the stringified content or a simple index as the React key during iteration.
When using a CDN like Cloudflare (Auto-Minify) or when dealing with special character encoding (e.g., Arabic/Unicode), the server-rendered string often differs slightly from the client-hydrated string:
Activity
Ammar123890 commentedon Feb 8, 2026
I'm seeing this exact same behavior in React Router v7, and looking at the source here in TanStack Router, it seems to share the same root cause.
In
packages/router/src/HeadContent.tsx(specifically around theScriptorMetacomponent rendering logic), the framework uses the stringified content or a simple index as the Reactkeyduring iteration.When using a CDN like Cloudflare (Auto-Minify) or when dealing with special character encoding (e.g., Arabic/Unicode), the server-rendered string often differs slightly from the client-hydrated string:
Server:
<script>...{"foo":"bar"}...</script>(Minified/Encoded)Client:
<script>...{ "foo": "bar" }...</script>(Standard formatting)React sees
Key(Server) !== Key(Client), assumes the server node is foreign, leaves it in the DOM (the duplicate), and appends a new one.We bypassed the framework's head management entirely for JSON-LD and moved the
<script>tag directly into the Component BodyThis forces React to manage the script lifecycle natively as part of the component tree, completely avoiding the hydration mismatch in the
<head>.AlexandreSi commentedon Feb 9, 2026
Hi,
I have a similar issue: I have the empty script tag and nothing inside, but the correct ld+json tag is nowhere to be found.
Ammar123890 commentedon Feb 10, 2026
@AlexandreSi
Can you share some snapshots of your code?
AlexandreSi commentedon Feb 10, 2026
Hi @Ammar123890,
Thank you for your response.
I created a new issue with all the details here: #6627