title: React app on Vercel - 404 not found error after adding Web Worker
body: <p>I have my React app deployed to Vercel, and it was working until I added a web worker and a background task.</p>
  <p>The app still builds and deploys with no error, but when I visit the url I get a 404 not found error.</p>
  <p>It still runs fine locally as well.</p>
  <p>I'm assuming it's the way I've set up the web worker  using React-App-Rewired.</p>
  <p>I use Rewired to avoid 'ejecting' my app, and it had me create a config-overrides.js (which I think is to override defaults in Webpack)</p>
  <p>config-override.js</p>
  <pre><code>
  module.exports = function override(config, env) {
      config.module.rules.push({
          test: /\.worker\.js$/,
          use: { loader: 'worker-loader' },
          
        })
   
      return config;
    }
  
  </code></pre>
  <p>I think the problem is that Vercel is not finding the file paths correctly.</p>
  <p>I tried a few approaches to fix this that I found here: <a href="https://github.com/webpack-contrib/worker-loader/issues/176" rel="nofollow noreferrer">https://github.com/webpack-contrib/worker-loader/issues/176</a></p>
  <p>Like adding this line before returning config:</p>
  <pre><code>   config.output.globalObject = '(self || this)'
  </code></pre>
  <p>It looks like people who use Next.js have had a similar problem and they fixed it like this:</p>
  <pre><code>module.exports = {
    webpack: config =&gt; {
      config.module.rules.push({
        test: /\.worker\.js$/,
        loader: 'worker-loader',
        options: {
          name: 'static/[hash].worker.js',
          publicPath: '/_next/'
        }
      })
  
      config.output.globalObject = `(typeof self !== 'undefined' ? self : this)`
  
      return config
    }
  }
  </code></pre>
  <p>But I'm not using Next.</p>
  <p>package.json scripts.</p>
  <pre><code>   &quot;scripts&quot;: {
          &quot;predeploy&quot;: &quot;npm run build&quot;,
          &quot;deploy&quot;: &quot;gh-pages -d build&quot;,
          &quot;start&quot;: &quot;react-app-rewired  start&quot;,
          &quot;build&quot;: &quot;react-app-rewired  build&quot;,
          &quot;test&quot;: &quot;react-app-rewired  test --env=jsdom-fourteen&quot;,
          &quot;eject&quot;: &quot;react-scripts eject&quot;
      },
  
  </code></pre>
  <p>An image so you can see my file structure (again it was working locally so I think everything is setup ok)</p>
  <p><a href="https://i.stack.imgur.com/0G4pt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0G4pt.png" alt="enter image description here" /></a></p>
  <p>And here is the tutorial I followed to get set up with React-App-Rewired and web workers: <a href="https://medium.com/@danilog1905/how-to-use-web-workers-with-react-create-app-and-not-ejecting-in-the-attempt-3718d2a1166b" rel="nofollow noreferrer">https://medium.com/@danilog1905/how-to-use-web-workers-with-react-create-app-and-not-ejecting-in-the-attempt-3718d2a1166b</a></p>
  <p>Any help is appreciated. Thanks!!</p>