title: PWA Simple Demo - Error when add pwabuilder-sw-register.js
body: <p><strong>Hello,</strong></p>
  
  <p>I'm trying to create a simple PWA demo by following the steps of this article: "<a href="https://docs.microsoft.com/en-us/microsoft-edge/progressive-web-apps-chromium/get-started" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/microsoft-edge/progressive-web-apps-chromium/get-started</a>"</p>
  
  <p>However when I reach the step to download and add the files: "pwabuilder-sw.js" and "pwabuilder-sw-register.js" to root and then add <code>&lt;script src="/pwabuilder-sw-register.js"&gt;&lt;/script&gt;</code> to the head of index.html I got error on Edge browser: "SCRIPT1086: SCRIPT1086: Module import or export statement unexpected here" I search around and I find that I have to add type="module" like this <code>&lt;script src="/pwabuilder-sw-register.js" type="module"&gt;&lt;/script&gt;</code> but now I'm getting another error: "0: Unable to get property 'define' of undefined or null reference" in 
  pwaupdate (175,5829)</p>
  
  <p>My page code looks like:</p>
  
  <p>Index.html</p>
  
  <pre><code>&lt;html&gt;
  
  &lt;head&gt;
    &lt;title&gt;Express&lt;/title&gt;
    &lt;link rel="stylesheet" href="/stylesheets/style.css"&gt;
    &lt;link rel="manifest" href="/manifest.json"&gt;
    &lt;script src="/pwabuilder-sw-register.js" type="module"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;h1&gt;Express 2&lt;/h1&gt;
    &lt;p&gt;Welcome to Express&lt;/p&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>pwabuilder-sw.js</p>
  
  <pre><code>// This is the service worker with the Cache-first network
  
  const CACHE = "pwabuilder-precache";
  
  importScripts('https://storage.googleapis.com/workbox-cdn/releases/5.0.0/workbox-sw.js');
  
  self.addEventListener("message", (event) =&gt; {
    if (event.data &amp;&amp; event.data.type === "SKIP_WAITING") {
      self.skipWaiting();
    }
  });
  
  workbox.routing.registerRoute(
    new RegExp('/*'),
    new workbox.strategies.CacheFirst({
      cacheName: CACHE
    })
  );
  </code></pre>
  
  <p>pwabuilder-sw-register.js</p>
  
  <pre><code>// This is the service worker with the Cache-first network
  
  // Add this below content to your HTML page inside a &lt;script type="module"&gt;&lt;/script&gt; tag, or add the js file to your page at the very top to register service worker
  
  import 'https://cdn.jsdelivr.net/npm/@pwabuilder/pwaupdate';
  
  const el = document.createElement('pwa-update');
  document.body.appendChild(el);
  </code></pre>
  
  <p>I searched a lot but I did not find any clue.</p>
  
  <p>Please advise.</p>