Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested jsx tags inside <Link> cause hydration error in SolidStart (SSR) #3742

Open
kiahjh opened this issue Mar 11, 2025 · 1 comment
Open
Labels
external: @solidjs/start Related to usage of `@tanstack/solid-router` within `@solidjs/start` package: solid-router ssr Everything around SSR the story

Comments

@kiahjh
Copy link
Contributor

kiahjh commented Mar 11, 2025

Which project does this relate to?

Router

Describe the bug

If I nest any jsx tags inside the <Link> tag provided by @tanstack/solid-router (example: <Link to="/"><b>Home</b></Link>), it causes the following error:

TypeError: template2 is not a function at getNextElement (http://localhost:3000/_build/node_modules/.vinxi/client/deps/chunk-4JBQOQO5.js?v=a56f0fa8:290:12) at Object.fn (http://localhost:3000/_build/node_modules/.vinxi/client/deps/chunk-4JBQOQO5.js?v=a56f0fa8:675:43) at runComputation (http://localhost:3000/_build/node_modules/.vinxi/client/deps/chunk-IYP4Z4GE.js?v=a56f0fa8:729:22) at updateComputation (http://localhost:3000/_build/node_modules/.vinxi/client/deps/chunk-IYP4Z4GE.js?v=a56f0fa8:711:3) at Object.readSignal (http://localhost:3000/_build/node_modules/.vinxi/client/deps/chunk-IYP4Z4GE.js?v=a56f0fa8:647:67) at resolveChildren (http://localhost:3000/_build/node_modules/.vinxi/client/deps/chunk-IYP4Z4GE.js?v=a56f0fa8:1025:84) at resolveChildren (http://localhost:3000/_build/node_modules/.vinxi/client/deps/chunk-IYP4Z4GE.js?v=a56f0fa8:1029:22) at resolveChildren (http://localhost:3000/_build/node_modules/.vinxi/client/deps/chunk-IYP4Z4GE.js?v=a56f0fa8:1025:68) at resolveChildren (http://localhost:3000/_build/node_modules/.vinxi/client/deps/chunk-IYP4Z4GE.js?v=a56f0fa8:1025:68) at resolveChildren (http://localhost:3000/_build/node_modules/.vinxi/client/deps/chunk-IYP4Z4GE.js?v=a56f0fa8:1025:68)

Your Example Website or App

https://github.com/kiahjh/ts-router-solid-start-ssr-link-bug-demo/blob/master/src/routes/__root.tsx#L17

Steps to Reproduce the Bug or Issue

  1. pnpm create solid@latest
  2. choose SolidStart
  3. choose tanstack-router template
  4. Find a <Link> tag and nest some jsx in it

Expected behavior

No error; for instance, a <b> tag should just make the content bold without causing a hydration error.

Screenshots or Videos

No response

Platform

  • OS: macOS
  • Browser: Arc (Chromium)
  • Version: Chromium v134.0.6998.45

Additional context

No response

@birkskyum birkskyum changed the title Nested jsx tags inside <Link> cause hydration error in Solid Start (SSR) Nested jsx tags inside <Link> cause hydration error in SolidStart (SSR) Mar 12, 2025
@birkskyum birkskyum added external: @solidjs/start Related to usage of `@tanstack/solid-router` within `@solidjs/start` ssr Everything around SSR the story labels Mar 12, 2025
@brenelz
Copy link
Contributor

brenelz commented Mar 12, 2025

Actually I think this probably makes more sense for this bug to be in SolidStart. It seems like it works within Tanstack router itself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external: @solidjs/start Related to usage of `@tanstack/solid-router` within `@solidjs/start` package: solid-router ssr Everything around SSR the story
Projects
None yet
Development

No branches or pull requests

4 participants