title: Cannot install service worker in Chrome
body: <p>I am trying to use service workers in Chrome on <strong>localhost:3000</strong>.
  My app is using AngularJS 1.5.</p>
  
  <p>The service worker state is not activating. It is going from <strong>installing</strong> to <strong>redundant</strong>.</p>
  
  <pre><code>if ('serviceWorker' in navigator) {
    navigator.serviceWorker
      .register('/service-worker.js')
      .then(function(registration) {
          var serviceWorker;
          if (registration.installing) {
              serviceWorker = registration.installing;
          } else if (registration.waiting) {
              serviceWorker = registration.waiting;
          } else if (registration.active) {
              serviceWorker = registration.active;
          }
  
          if (serviceWorker) {
              console.log("ServiceWorker phase:", serviceWorker.state);
  
              serviceWorker.addEventListener('statechange', function (e) {
                  console.log("ServiceWorker phase:", e.target.state);
              });
          }
      })
      .catch(function(err) {
          console.log('Service Worker Error', err);
      });
  }
  </code></pre>
  
  <p><em>Output of above script:</em></p>
  
  <blockquote>
    <p>ServiceWorker phase: installing</p>
    
    <p>ServiceWorker phase: redundant</p>
  </blockquote>
  
  <p><code>service-worker.js</code> is available at <a href="http://localhost:3000/service-worker.js" rel="nofollow noreferrer">http://localhost:3000/service-worker.js</a>. I don't see any error messages. What am I doing wrong?</p>