1

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?

Tuan
  • 11
  • 1
  • 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!!! – Tuan Dec 24 '21 at 01:23
  • hello how did you do it? Im trying npm i react-scripts@4.0.3 but got a lot of errors post installation, app still broken – yieniggu Dec 31 '21 at 16:39
  • 1
    I did the same with this command line npm i react-scripts@4.0.3 – Tuan Jan 03 '22 at 09:11
  • Does this answer your question? [Web3 Issue : React Application not compiling](https://stackoverflow.com/questions/70472965/web3-issue-react-application-not-compiling) – Yilmaz Jan 05 '22 at 03:14

0 Answers0