Make sure you are using compatible versions of React, Zustand, and react-dom. In my case, it turned out to be my node version that was outdated. Switching to node v20.x from v16.x solved the problem.