-
Notifications
You must be signed in to change notification settings - Fork 125
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
[storage] signal is not updated during hydration when doing SSR or SSG #501
Comments
It's different from #480. There are two issues in this:
|
You can create StackBlitz projects with Solid-Start using https://stackblitz.com/fork/github/solidjs/solid-start/tree/main/examples/bare However Solid-Start 0.3.1 requires Node.js 18, and StackBlitz is still using Node.js 16, so I have this one with Solid-Start downgraded: https://stackblitz.com/edit/solidjs-solid-start-961vf8?file=package.json |
Thanks for the quick reply! True that adding the (I forked the StackBlitz but seems the newest |
Describe The Problem To Be Solved
Reproduce by creating a new solid-start project from the
bare
template with SSR and change the line in Counter.tsx to:(Sorry I couldn't find a stackblitz template with solid-start.)
If you increase the counter and then reload the page, the counter isn't rendered and you get in the console:
Similarly, using Astro's
client:load
directive (which does server-side render or generate the HTML in SSG-mode), on page-load the counter is always0
.Suggest A Solution
While it's unavoidable that the initial HTML contains
0
(since we cannot know the value of localStorage on the server), ideallystorage
would update the signal during or after hydration to read out the value fromlocalStorage
.The text was updated successfully, but these errors were encountered: