Skip to content

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

Description

@TylerRick

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().

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions