Skip to content
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

Jotai not working #512

Open
prabirshrestha opened this issue Mar 2, 2025 · 0 comments
Open

Jotai not working #512

prabirshrestha opened this issue Mar 2, 2025 · 0 comments

Comments

@prabirshrestha
Copy link

Current Behavior

using Jotai throws error.

Error rendering / on server
Cannot read properties of null (reading 'useContext')
                    TypeError: Cannot read properties of null (reading 'useContext')
    at process.env.NODE_ENV.exports.useContext (/Users/ps/code/demo/apps/app/node_modules/react/cjs/react.development.js:1464:25)
    at useStore (file:///Users/ps/code/demo/apps/app/node_modules/jotai/esm/react.mjs:9:17)
    at useAtomValue (file:///Users/ps/code/demo/apps/app/node_modules/jotai/esm/react.mjs:96:17)
    at useAtom (file:///Users/ps/code/demo/apps/app/node_modules/jotai/esm/react.mjs:153:5)
    at AppShell (/Users/ps/code/demo/apps/app/src/interface/appShell/appShell.tsx:16:27)

Expected Behavior

should work without errors

One Version

1.1.459

Platform (Web, iOS, Android)

Web

Reproduction

add the dependency using `bun add jotai`.

add the following code to one of the route.


export const helloAtom = atom('hello');

export function HomePage() {
   const [hello] = useAtom(helloAtom);
   return <>{hello}</>;
}


versions:

    "one": "1.1.459",
    "jotai": "^2.12.1",

System Info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant