title: Webpack breaking changes for builtin modules on Gatsby site
body: <p>I've tried deploying my Gatsby site to Netlify, but I keep getting these errors for various node modules whenever I try to deploy. I've tried making a webpack.config.js file and including both of the suggested solutions to no avail. I've also tried using alias instead of fallback, adding a browser section to the package.json file which sets the modules to false, and adding a target property in the webpack.config.js file as some other stackoverflow answers have suggested, but I'm still pretty stuck. I don't have any prior experience to webpack and have been doing my best to look for answers. Is there some sort of special configuration for this with Gatsby that I'm missing?</p>
  <p><strong>Error message</strong></p>
  <pre><code>10:37:20 AM: error Generating JavaScript bundles failed
  10:37:20 AM: Can't resolve 'stream' in '/opt/build/repo/node_modules/cipher-base'
  10:37:20 AM: If you're trying to use a package make sure that 'stream' is installed. If you're trying to use a local file make sure that the path is correct.
  10:37:20 AM: BREAKING CHANGE: webpack &lt; 5 used to include polyfills for node.js core modules by default.
  10:37:20 AM: This is no longer the case. Verify if you need this module and configure a polyfill for it.
  10:37:20 AM: If you want to include a polyfill, you need to:
  10:37:20 AM:    - add a fallback 'resolve.fallback: { &quot;stream&quot;: require.resolve(&quot;stream-browserify&quot;) }'
  10:37:20 AM:    - install 'stream-browserify'
  10:37:20 AM: If you don't want to include a polyfill, you can use an empty module like this:
      resolve.fallback: { &quot;stream&quot;: false }
  </code></pre>
  <p><strong>webpack.config.js</strong></p>
  <pre><code>module.exports = {
      target: 'node14.17',
      resolve: {
          fallback: {
              assert: require.resolve(&quot;assert/&quot;),
              crypto: require.resolve(&quot;crypto-browserify&quot;),
              http:  require.resolve(&quot;stream-http&quot;),
              https: require.resolve(&quot;https-browserify&quot;),
              os: require.resolve(&quot;os-browserify/browser&quot;),
              stream: require.resolve(&quot;stream-browserify&quot;),
          },
      },
  }
  </code></pre>
  <p><strong>package.json</strong></p>
  <pre><code>{
    &quot;name&quot;: &quot;gatsby-starter-default&quot;,
    &quot;private&quot;: true,
    &quot;description&quot;: &quot;A simple starter to get up and developing quickly with Gatsby&quot;,
    &quot;version&quot;: &quot;0.1.0&quot;,
    &quot;author&quot;: &quot;Kyle Mathews &lt;mathews.kyle@gmail.com&gt;&quot;,
    &quot;dependencies&quot;: {
      &quot;crypto-browserify&quot;: &quot;^3.12.0&quot;,
      &quot;ethers&quot;: &quot;^5.4.5&quot;,
      &quot;gatsby&quot;: &quot;^3.11.1&quot;,
      &quot;gatsby-plugin-gatsby-cloud&quot;: &quot;^2.11.0&quot;,
      &quot;gatsby-plugin-google-fonts&quot;: &quot;^1.0.1&quot;,
      &quot;gatsby-plugin-image&quot;: &quot;^1.11.0&quot;,
      &quot;gatsby-plugin-manifest&quot;: &quot;^3.11.0&quot;,
      &quot;gatsby-plugin-offline&quot;: &quot;^4.11.0&quot;,
      &quot;gatsby-plugin-react-helmet&quot;: &quot;^4.11.0&quot;,
      &quot;gatsby-plugin-sharp&quot;: &quot;^3.11.0&quot;,
      &quot;gatsby-source-filesystem&quot;: &quot;^3.11.0&quot;,
      &quot;gatsby-transformer-sharp&quot;: &quot;^3.11.0&quot;,
      &quot;https-browserify&quot;: &quot;^1.0.0&quot;,
      &quot;os-browserify&quot;: &quot;^0.3.0&quot;,
      &quot;prop-types&quot;: &quot;^15.7.2&quot;,
      &quot;react&quot;: &quot;^17.0.1&quot;,
      &quot;react-dom&quot;: &quot;^17.0.1&quot;,
      &quot;react-helmet&quot;: &quot;^6.1.0&quot;,
      &quot;stream-browserify&quot;: &quot;^3.0.0&quot;,
      &quot;stream-http&quot;: &quot;^3.2.0&quot;,
      &quot;web3&quot;: &quot;^1.5.2&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;prettier&quot;: &quot;2.3.2&quot;
    },
    &quot;browser&quot;: {
      &quot;assert&quot;: false,
      &quot;crypto&quot;: false,
      &quot;http&quot;:   false,
      &quot;https&quot;:  false
    },
    &quot;keywords&quot;: [
      &quot;gatsby&quot;
    ],
    &quot;license&quot;: &quot;0BSD&quot;,
    &quot;scripts&quot;: {
      &quot;build&quot;: &quot;gatsby build&quot;,
      &quot;develop&quot;: &quot;gatsby develop&quot;,
      &quot;format&quot;: &quot;prettier --write \&quot;**/*.{js,jsx,ts,tsx,json,md}\&quot;&quot;,
      &quot;start&quot;: &quot;npm run develop&quot;,
      &quot;serve&quot;: &quot;gatsby serve&quot;,
      &quot;clean&quot;: &quot;gatsby clean&quot;,
      &quot;test&quot;: &quot;echo \&quot;Write tests! -&gt; https://gatsby.dev/unit-testing\&quot; &amp;&amp; exit 1&quot;
    },
    &quot;repository&quot;: {
      &quot;type&quot;: &quot;git&quot;,
      &quot;url&quot;: &quot;https://github.com/gatsbyjs/gatsby-starter-default&quot;
    },
    &quot;bugs&quot;: {
      &quot;url&quot;: &quot;https://github.com/gatsbyjs/gatsby/issues&quot;
    }
  }
  </code></pre>