title: import web3 into react js getting BREAKING CHANGE: webpack < 5 used to incl
body: <p>I am having problems with importing web3 into reactjs. To replicate my problem, initiallize a new react app as so</p>
  <pre><code>npx create-react-app my-app
  cd my-app
  </code></pre>
  <p>then open terminal in this location. Write:</p>
  <pre><code>npm install web3
  npm install
  </code></pre>
  <p>in the App,js file add the following line</p>
  <pre><code>import Web3 from &quot;web3&quot;; 
  </code></pre>
  <p>I got the error after I do <code>npm start</code> then I got the unsolved error which is</p>
  <blockquote>
  <p>Module not found: Error: Can't resolve 'stream'</p>
  <p>Module not found: Error: Can't resolve 'crypto'</p>
  </blockquote>
  <p>I tried finding a solution online, in particular I tried each of</p>
  <ol>
  <li><a href="https://stackoverflow.com/questions/64557638/how-to-polyfill-node-core-modules-in-webpack-5">How to Polyfill node core modules in webpack 5</a></li>
  <li><a href="https://www.youtube.com/watch?v=u1PPNIBvQjk" rel="nofollow noreferrer">https://www.youtube.com/watch?v=u1PPNIBvQjk</a></li>
  <li><a href="https://stackoverflow.com/questions/70439959/importing-web3-causing-a-problem-in-react-js">Importing web3 causing a problem in react js</a></li>
  <li><a href="https://github.com/facebook/create-react-app/issues/11756#issuecomment-1001162736" rel="nofollow noreferrer">https://github.com/facebook/create-react-app/issues/11756#issuecomment-1001162736</a></li>
  <li><a href="https://namespaceit.com/blog/how-fix-breaking-change-webpack-5-used-to-include-polyfills-for-nodejs-core-modules-by-default-error" rel="nofollow noreferrer">https://namespaceit.com/blog/how-fix-breaking-change-webpack-5-used-to-include-polyfills-for-nodejs-core-modules-by-default-error</a></li>
  <li><a href="https://stackoverflow.com/questions/70712236/how-to-create-react-app-including-web3-using-create-react-app-i-am-getting-modu">How to create React App including Web3 using create-react-app? I am getting Module not found Error. BREAKING CHANGE: webpack &lt; 5 used</a></li>
  </ol>
  <p>None seem to work with me. Is there any advice on how to solve this problem?
  Thank you!</p>