Seeing Uncaught TypeError: Cannot read properties of null (reading 'useState')
Describe the bug
After following the quick start and running pnpm start:client I see this error in the javascript console:
Uncaught TypeError: Cannot read properties of null (reading 'useState')
at exports.useState (chunk-WGQ5ZIYR.js?v=5c077f48:1094:35)
at useToast (use-toast.ts:169:37)
at useVersion (use-version.tsx:9:23)
at App (App.tsx:22:5)
at react-stack-bottom-frame (react-dom_client.js?v=f34b75e1:16190:20)
at renderWithHooks (react-dom_client.js?v=f34b75e1:4304:24)
at updateFunctionComponent (react-dom_client.js?v=f34b75e1:5970:21)
at beginWork (react-dom_client.js?v=f34b75e1:7046:20)
at runWithFiberInDEV (react-dom_client.js?v=f34b75e1:724:18)
at performUnitOfWork (react-dom_client.js?v=f34b75e1:10829:98)
To Reproduce
- Follow the quickstart guide
- run pnpm start
- run pnpm start:client in a new terminal window
- open http://localhost:5173/ in the browser (you will see black screen)
- open the chrome dev tools console and see error
Expected behavior
Should load site without errors
Screenshots
Additional context
This started happening today after pulling latest version (v0.1.8).
Hello @adaro! Welcome to the elizaOS community. Thank you for opening your first issue; we appreciate your contribution. You are now an elizaOS contributor!
Hello I have the same issue pleas help ! Thanks
fetch latest & run
pnpm cleanpnpm install --no-frozen-lockfilepnpm build
im also getting this and am on the latest.
facing same error
@KennethAshley @im-vignesh @tomzed
Unable to reproduce this to fix this. The error shows undefined for useState which makes it seem as if React is not properly installed.
Can you guys try @wtfsayo 's solution:
pnpm clean
pnpm install --no-frozen-lockfile
pnpm build
and give us feedback whether this has resolved this for you?
@JoeyKhd i've tried those steps multiple times and am still getting the same issue. when running those commands i don't get any errors. when i start the client i also get no errors. but when navigate to localhost:5173 i get the following error:
i am on build 0.1.8+build.1
I will have another look and try to circle back as soon as I can @KennethAshley
Try update pnpm to version 9+ and it should work
I was able to fix this issue by following these steps:
- First, if pnpm was installed with Homebrew, remove it:
brew uninstall pnpm
- Then run these commands in sequence:
npm uninstall -g pnpm
curl -fsSL https://get.pnpm.io/install.sh | env PNPM_VERSION=10.0.0 sh -
pnpm env use --global 23
pnpm clean
pnpm install --no-frozen-lockfile
pnpm build
pnpm start:client
Hope it helps!