0

I tried use web3 in Reactjs but when I import web3 it has error :

webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it.

I use nodejs 14.18 and webpack 5.5.0

2 Answers 2

2

I solved this error with changing react-scripts version to '^4.0.3' according to this link : https://forum.moralis.io/t/problem-with-web3ui/12725/5

Sign up to request clarification or add additional context in comments.

Comments

0

Use resolutions in package.json (only work on yarn)

  "resolutions": {
    "webpack": "5.5.0" // <- Add require version
  }
yarn install

Example from my Code

Example of my Code

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.