0

After created a ReactJS project. I installed Web3 to that project and just import Web3 But after imported, I got these error messages:

Failed to compile.

Module not found: Error: Can't resolve 'stream' in '/Users/tuan/Documents/projects/faucet-react/node_modules/cipher-base' BREAKING CHANGE: 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.

If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
- install 'stream-browserify' If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "stream": false } assets by path static/js/*.js 6.09 MiB asset static/js/bundle.js 6.08 MiB [emitted]
(name: main) 1 related asset asset
static/js/node_modules_web-vitals_dist_web-vitals_js.chunk.js 6.89 KiB
[emitted] 1 related asset asset index.html 1.67 KiB [emitted] asset
asset-manifest.json 458 bytes [emitted] cached modules 5.9 MiB
[cached] 899 modules runtime modules 31.5 KiB 17 modules

Are these issues from the react-script version?

4
  • I found the solution. It was the react-script version. So the version 5.0.0 was the issue and I downgraded it to 4.0.3 and it is working fine!!! Commented Dec 24, 2021 at 1:23
  • hello how did you do it? Im trying npm i [email protected] but got a lot of errors post installation, app still broken Commented Dec 31, 2021 at 16:39
  • 1
    I did the same with this command line npm i [email protected] Commented Jan 3, 2022 at 9:11
  • Does this answer your question? Web3 Issue : React Application not compiling Commented Jan 5, 2022 at 3:14

0

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.