eliza icon indicating copy to clipboard operation
eliza copied to clipboard

Seeing Uncaught TypeError: Cannot read properties of null (reading 'useState')

Open adaro opened this issue 11 months ago • 11 comments

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

  1. Follow the quickstart guide
  2. run pnpm start
  3. run pnpm start:client in a new terminal window
  4. open http://localhost:5173/ in the browser (you will see black screen)
  5. open the chrome dev tools console and see error

Expected behavior

Should load site without errors

Screenshots

Screenshot 2025-01-12 at 6 00 19 PM

Additional context

This started happening today after pulling latest version (v0.1.8).

adaro avatar Jan 13 '25 02:01 adaro

Hello @adaro! Welcome to the elizaOS community. Thank you for opening your first issue; we appreciate your contribution. You are now an elizaOS contributor!

github-actions[bot] avatar Jan 13 '25 02:01 github-actions[bot]

Hello I have the same issue pleas help ! Thanks

tomzed avatar Jan 13 '25 16:01 tomzed

fetch latest & run

  • pnpm clean
  • pnpm install --no-frozen-lockfile
  • pnpm build

wtfsayo avatar Jan 13 '25 17:01 wtfsayo

im also getting this and am on the latest.

KennethAshley avatar Jan 15 '25 02:01 KennethAshley

facing same error

im-vignesh avatar Jan 15 '25 11:01 im-vignesh

@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 avatar Jan 15 '25 15:01 JoeyKhd

@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:

CleanShot 2025-01-15 at 11 13 47@2x

i am on build 0.1.8+build.1

KennethAshley avatar Jan 15 '25 16:01 KennethAshley

I will have another look and try to circle back as soon as I can @KennethAshley

JoeyKhd avatar Jan 15 '25 16:01 JoeyKhd

Try update pnpm to version 9+ and it should work

tomzed avatar Jan 15 '25 19:01 tomzed

I was able to fix this issue by following these steps:

  1. First, if pnpm was installed with Homebrew, remove it:
brew uninstall pnpm
  1. 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!

im-vignesh avatar Jan 15 '25 19:01 im-vignesh