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
- Go to https://stackblitz.com/edit/solidjs-templates-chv1jk?file=src/pages/index.page.tsx
- Open (browser) inspect.
- 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:
- Created 10 months ago
- Comments:12 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@samuelstroschein Yeah npm also crashes for me.
@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?