title: Why is my service worker not registering?
body: <p>This is my index.js file:</p>
  
  <pre><code>import React from 'react';
  import ReactDOM from 'react-dom';
  import App from './App';
  
  ReactDOM.render(
  &lt;App /&gt;,
  document.getElementById('app')
  </code></pre>
  
  <p>);</p>
  
  <pre><code>if ('serviceWorker' in navigator) {
          window.addEventListener('load', () =&gt; {
              console.log('window loaded')
              navigator.serviceWorker
              .register('./serviceWorker.js')
              .then(reg =&gt; {
                  console.log('Service worker registered value', reg);
              })
              .catch(err =&gt; {
                  console.log(`Service worker Error: ${err}`);
              })
          })
      };
  </code></pre>
  
  <p>This is my serviceWorker.js file:</p>
  
  <pre><code>self.addEventListener('install', (e) =&gt; {
      console.log('Service Worker Installed');
  });
  </code></pre>
  
  <p>The error I get is:
  Service worker Error: TypeError: Failed to register a ServiceWorker for scope ('<a href="https://spark.generaltraffic.co.uk/" rel="nofollow noreferrer">https://spark.generaltraffic.co.uk/</a>') with script ('<a href="https://spark.generaltraffic.co.uk/serviceWorker.js" rel="nofollow noreferrer">https://spark.generaltraffic.co.uk/serviceWorker.js</a>'): A bad HTTP response code (403) was received when fetching the script.</p>