-
-
Notifications
You must be signed in to change notification settings - Fork 622
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
createJSONStorage
: localStorage is not defined
#2581
Comments
atomWithStorage
: localStorage is not definedcreateJSONStorage
: localStorage is not defined
Having the same issue for sessionStorage. I believe 2.8.2 start calling the storage fn on server side. |
Ohhhh, that was it. #2539 (comment) #2539 broke it. |
@dai-shi on it. |
Can any of you confirm if #2585 fixes your case? |
@dai-shi it works, thanks! PS: I'm using yarn v4: this version should be added in the second step of "Local Install Instructions" of CodeSandbox CI |
Thanks for confirming! (Yeah, but it's out of my control.) |
@dai-shi
my code:
|
Also tested with the Local Instructions: |
it is hard for me create a reproduction as I am using vite + fastify to create an SSR output |
Does it work with v2.8.1? Otherwise, it's probably a different thing. |
Nope, same issue. as in I can reproduce it in v2.8.1 |
|
In #2581, we discussed and solved the issue specific with v2.8.2. |
Summary
Details
Next.js:
14.2.3
jotai:
2.8.2
It correctly works with jotai <= 2.8.1.
Issue probably generated by #2539
Similar issue #949
The text was updated successfully, but these errors were encountered: