title: Failed to register service worker
body: <p>I have a problem with the register service worker.</p>
  
  <p>When I run my service worker in <code>localhost</code> to test him I see this error:</p>
  
  <pre><code>dont Activated: TypeError: Failed to register a ServiceWorker: A bad HTTP response code (404) was received when fetching the script.
  </code></pre>
  
  <p>This is my service worker registration code - all this code in app.js file:</p>
  
  <pre><code>if('serviceWorker' in navigator) {
      navigator
       .serviceWorker
       .register('/service-worker.js').then(registration =&gt; {
           console.log('Service worker has been Activted  :' , registration);
       }).catch(err =&gt; {
           console.log('dont Activated:' , err )
       })
  } else {
      console.log('Servise workers not actived')
  }
  </code></pre>
  
  <p>My service-worker.js file is in my root folder!</p>
  
  <p>I linked all the files carefully.</p>