Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
microchipgnu opened this issue Jul 2, 2023 · 1 comment

Comments

@microchipgnu
Copy link

Describe the bug
I am trying to add new functionality to the VM but have encountered a problem during the build and link process. Specifically, I'm seeing the error react.development.js:1622 Uncaught TypeError: Cannot read properties of null (reading 'useState'). It seems as though there might be two versions of React running concurrently, although react and react-dom are peer dependencies on the VM project.

Environment

  • Node.js version: 18.15.0
  • pnpm version: 8.6.5

To Reproduce
I've followed these steps:

  1. Cloned near/near-discovery into the same workspace as the VM project.
  2. Ran pnpm i on both /vm and /near-discovery.
  3. In /vm, ran pnpm build.
  4. In /near-discovery, ran pnpm link ../vm and then pnpm dev.

Expected behavior
My expectation was to build and link the VM successfully with the 'near-discovery' project, allowing me to continue with my implementation of new functionality.

Actual results
However, I've run into a TypeError during the build process as outlined above. This issue is preventing me from proceeding with my work.

I suspect the error might be due to conflicting versions of React, but I'm unsure of how to resolve this issue.

Additional context
Any help with debugging this issue would be greatly appreciated. If more information is required, please let me know.

@evgenykuzyakov
Copy link
Contributor

I'm unaware of the latest setup that near.org uses, but here is how I resolved conflicting issues in the near.social: https://github.com/NearSocial/viewer/blob/72ef6d08f649cd8f70c4543c8b858b7074fbf526/webpack.config.js#L57-L61
It might be better to ask about this in near-discovery repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants