Giter Site home page Giter Site logo

Comments (14)

dai-shi avatar dai-shi commented on September 27, 2024 2

Can any of you confirm if #2585 fixes your case?
https://ci.codesandbox.io/status/pmndrs/jotai/pr/2585
☝️ Find "Local Install Instructions"

from jotai.

fernandojbf avatar fernandojbf commented on September 27, 2024 1

Having the same issue for sessionStorage.

I believe 2.8.2 start calling the storage fn on server side.

from jotai.

rtritto avatar rtritto commented on September 27, 2024 1

@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

from jotai.

dai-shi avatar dai-shi commented on September 27, 2024 1

Does it work with v2.8.1? Otherwise, it's probably a different thing.

from jotai.

dai-shi avatar dai-shi commented on September 27, 2024 1

It correctly works with jotai <= 2.8.1.

In #2581, we discussed and solved the issue specific with v2.8.2.
If v2.8.1 doesn't solve your case, please open a new bug report 👉 https://github.com/pmndrs/jotai/discussions/new?category=bug-report
Or, a question https://github.com/pmndrs/jotai/discussions/new?category=q-a if you don't have a reproduction.

from jotai.

omridevk avatar omridevk commented on September 27, 2024 1

Thanks @dai-shi for the quick response.
#2639
And I will open an issue once I can reproduce it in stackblitz/codesandbox or a repo.
Really love this lib by the. way, appreciate all your hard work sensei

from jotai.

dai-shi avatar dai-shi commented on September 27, 2024

Ohhhh, that was it. #2539 (comment)
Thanks for reporting.

#2539 broke it.
@mhsattarian Would you like to fix?

from jotai.

mhsattarian avatar mhsattarian commented on September 27, 2024

@dai-shi on it.

from jotai.

dai-shi avatar dai-shi commented on September 27, 2024

Thanks for confirming!

(Yeah, but it's out of my control.)

from jotai.

omridevk avatar omridevk commented on September 27, 2024

@dai-shi
Checking with version 2.8.4
I am still getting:

15:18:41 [vite] Error when evaluating SSR module /src/components/wizard/wizard.tsx:
|- ReferenceError: sessionStorage is not defined

my code:

const storage = createJSONStorage<WizardAtom>(() => sessionStorage)

from jotai.

omridevk avatar omridevk commented on September 27, 2024

Also tested with the Local Instructions:
npm i https://pkg.csb.dev/pmndrs/jotai/commit/982fd7c7/jotai
same error

from jotai.

omridevk avatar omridevk commented on September 27, 2024

it is hard for me create a reproduction as I am using vite + fastify to create an SSR output

from jotai.

omridevk avatar omridevk commented on September 27, 2024

Nope, same issue. as in I can reproduce it in v2.8.1

from jotai.

omridevk avatar omridevk commented on September 27, 2024
15:52:21 [vite] Error when evaluating SSR module /src/atoms/wizard-data-atom.ts:
|- ReferenceError: localStorage is not defined
    at eval (/src/atoms/wizard-data-atom.ts:7:63)
    at Object.getItem (/node_modules/jotai/esm/vanilla/utils.mjs:372:31)
    at Module.atomWithStorage (/node_modules/jotai/esm/vanilla/utils.mjs:419:25)
    at eval (/src/atoms/wizard-data-atom.ts:8:46)
    at async instantiateModule (/vite/dist/node/chunks/dep-C1-ZB6nQ.js:53451:5)

from jotai.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.