pmndrs / zustand

🐻 Bear necessities for state management in React
https://zustand-demo.pmnd.rs/
MIT License
46.93k stars 1.45k forks source link

"useEffect" is not exported by "node_modules/react/index.js" #2640

Closed gabrielbacha closed 2 months ago

gabrielbacha commented 2 months ago

I have built an R3F app using Astro.js. When running dev it works properly. I am trying to export it to a static website using build but I get the below error. I am not using zustand directly but it is a dependency for the below

├─┬ @react-three/drei@9.108.3 │ ├─┬ tunnel-rat@0.1.2 │ │ └── zustand@4.5.4 │ └── zustand@3.7.2 ├─┬ @react-three/fiber@8.16.8 │ └── zustand@3.7.2 deduped ├─┬ leva@0.9.35 │ └── zustand@3.7.2 deduped └─┬ r3f-perf@7.2.1 └── zustand@4.5.4

"useEffect" is not exported by "node_modules/react/index.js", imported by "node_modules/zustand/esm/index.js". file: node_modules/zustand/esm/index.js:1:44

1: import { useReducer, useRef, useDebugValue, useEffect, useLayoutEffect } from 'react';