title: The script has an unsupported MIME type ('text/html')
body: <p>I am trying to setup Firebase Push for the <strong>Flutter Web platform</strong>.</p>
  <p>I have copied same setup as it is shown in the various tutorial and running into following error,</p>
  <pre><code>Uncaught (in promise) Error: [firebase_messaging/failed-service-worker-registration] Messaging: We are unable to register the default service worker. Failed to register a ServiceWorker for scope ('http://localhost:61027/firebase-cloud-messaging-push-scope') with script ('http://localhost:61027/firebase-messaging-sw.js'): The script has an unsupported MIME type ('text/html')
  </code></pre>
  <p>Here is an excerpt of my Index.html</p>
  <pre><code>&lt;script&gt;
      if ('serviceWorker' in navigator) {
        window.addEventListener('flutter-first-frame', function () {
          navigator.serviceWorker.register('/flutter_service_worker.js')
          .then(function(registration) {
        // Registration was successful
        console.log('ServiceWorker registration successful with scope: ', registration.scope);
      }, function(err) {
        // registration failed :(
        console.log('ServiceWorker registration failed: ', err);
      })
        });
   }
  &lt;/script&gt;
  &lt;script src=&quot;main.dart.js&quot; type=&quot;application/javascript&quot;&gt;&lt;/script&gt;
  </code></pre>
  <p>Index.html and flutter_service_worker.js are in the same folder.</p>
  <p>I am getting a successful service registration message. After receiving push permission I am using the following code to get token using following code and then getting error.</p>
  <pre><code>getIt&lt;FirebaseMessaging&gt;().getToken(vapidKey:&quot;xxx&quot;);
  </code></pre>
  <p>I am getting above mentioned error.</p>
  <p>Any help or direction would be appreciated.</p>