Skip to content
Source
Sign inSign up
TanStack/router

Solid Start 2.0.0-rc.0: a head() `scripts` entry is SSR’d with a hydration key that is never claimed #8107

ClosedTylerRick(GitHub profile, opens in a new tab) opened this issue 3 comments

Which project does this relate to?

Start

Describe the bug

A script declared through a route's head() is server-rendered with an _hk hydration key that the client never claims, so every page load logs:

Hydration completed with 1 unclaimed server-rendered node(s):
  <script _hk="0000010101149d40">window.__headScriptRan = true;</script>

The script itself works — it executes at parse time. title / meta / link entries from the same head() are claimed normally; only scripts entries are left over, one unclaimed node per script.

Nothing downstream breaks in the reproducer (the body hydrates and stays reactive), so this is cosmetic on its own. It matters because unclaimed-node warnings are how real hydration desyncs surface in Solid — a permanent benign one trains you to ignore the signal.

Complete minimal reproducer

https://github.com/TylerRick/tanstack-solid-head-scripts-repro

Steps to Reproduce the Bug or Issue

  1. pnpm install
  2. pnpm dev
  3. Open http://localhost:5587 with the browser console visible — the warning above is there on load.
  4. Controls, both in src/routes/__root.tsx: delete the scripts entry and the warning goes away; add a second script and there are two unclaimed nodes.

Expected behavior

Head scripts are either claimed at hydration like the other head entries, or rendered without a hydration key — so an app that uses head().scripts doesn't report unclaimed server-rendered nodes on every load.

Screenshots or Videos

No response

Platform

  • Router / Start Version: @tanstack/solid-start and @tanstack/solid-router 2.0.0-rc.0, @tanstack/router-core 1.171.16
  • solid-js / @solidjs/web: 2.0.0-rc.0
  • OS: Linux
  • Browser: Chromium 141
  • Bundler: vite 8.2.1 (vite-plugin-solid 3.0.0-next.27)

Additional context

Workaround we're using: render inline head scripts as direct JSX inside <head> in the root route's shellComponent instead of declaring them through head().

  1. please provide an actual reproducer project as a git repo. this is required. also don't paste your AI output here. write a concise description instead. future issues not following this will be closed

  2. schiller-manuel(GitHub profile, opens in a new tab) added labelsinformation needed

  3. Understood, sorry about that — I've replaced the body with a short description and a reproducer repo: https://github.com/TylerRick/tanstack-solid-head-scripts-repro

    I'll do the same on the other two I filed today (#8106, #8104).

  4. Should be fixed in the latest RC's. Open a new issue if there are still issues

Sign in to join this conversation.