jotai: "useAtomsDevtools/useAtomsSnapshot can only be used in dev mode" error in CRA v5
Awesome Project!
When trying to use useAtomsDevtools
in my application right now with a basic create-react-app boilerplate (react-scripts 5.0.0) I’m getting the following error:
Uncaught Error: useAtomsSnapshot can only be used in dev mode.
at useAtomsDevtools (devtools.js:148:1)
at AtomsDevtools (index.tsx:13:1)
The single atom useAtomDevtools
works without any issues and I’m able to see the values in the redux dev tools.
I cannot reproduce this on codesandbox, so I assumed I had some wrong environment variables, but I made sure I’m not running in production mode and all other debugging feature in react dev tools work correctly.
I’m using atoms providerless. My setup is Win 11 Node v16.13.1.
Do you have any idea what might be going wrong?
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 19 (11 by maintainers)
Thank you so much for your swift action. I have just confirmed Jotai 1.6 useAtomsDevtools does work on the React environment created with Vite.
Sure. We will do that. This requires quite a bit of work, so expect to take some time.
If we have
process
defined as object, it should work. Like in webpack 5: