question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

solidjs ssr with hydration "cannot read properties of null"

See original GitHub issue

🐛 Bug report

Any zag component crashes in SolidJS during the hydration of a server-rendered component.

The problem does not occur if a page is rendered client-side only via render.

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'nextSibling')
    at index.page.tsx:14:3
    at Checkbox (index.page.tsx:20:34)
    at @solid-refresh:10:42
    at untrack (chunk-CGI4PW6R.js?v=14626c3e:447:12)
    at Object.fn (@solid-refresh:10:28)
    at runComputation (chunk-CGI4PW6R.js?v=14626c3e:751:22)
    at updateComputation (chunk-CGI4PW6R.js?v=14626c3e:734:3)
    at createMemo (chunk-CGI4PW6R.js?v=14626c3e:253:5)
    at hmrCompWrapper (@solid-refresh:7:20)
    at chunk-CGI4PW6R.js?v=14626c3e:555:12

💥 Steps to reproduce

  1. Go to https://stackblitz.com/edit/solidjs-templates-chv1jk?file=src/pages/index.page.tsx
  2. Open (browser) inspect.
  3. The error should appear in the console right away. If not, refresh the preview.

💻 Link to reproduction

https://stackblitz.com/edit/solidjs-templates-chv1jk?file=src/pages/index.page.tsx

The renderer directory defines how the server renders a page and how the client hydrates it.

🧐 Expected behavior

No crash.

🌍 System information

Software Version(s)
Zag Version 0.2
Browser Chrome
Operating System MacOS

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
anubra266commented, Nov 9, 2022

@samuelstroschein Yeah npm also crashes for me.

0reactions
samuelstroscheincommented, Nov 9, 2022

@segunadebayo @anubra266 running the dev server with pnpm works for me too. running the dev server with npm leads to the crash. I’ll investigate further. Zag does not seem to be the root cause.

Could someone confirm whether running the reproduction with npm run dev crashes?

Read more comments on GitHub >

github_iconTop Results From Across the Web

SSR Specification · Issue #109 · solidjs/solid - GitHub
I think I recently read React doesn't resolve refs in Server environment. I wasn't sure what decisions made sense here. It was simpler....
Read more >
Documentation - SolidJS · Reactive Javascript Library
A declarative, efficient and flexible JavaScript library for building user interfaces.
Read more >
Cannot read property 'suppressHydrationWarning' of null
The issue was due to the input field having a ref attribute. Removing the ref attribute that wasn't that useful anyway fixed the...
Read more >
5 Places SolidJS is not the Best - DEV Community ‍ ‍
In this article, I wish to finally address the question "What is Solid not as good at?" The list might not be very...
Read more >
Streaming SolidJS - Server Rendering - YouTube
Going to talk about Server Rendering with SolidJS Framework[0:00] Welcome[4:55] Origins of SSR in Solid[10:08] Server Rendering ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found