title: Loading module was blocked because of a disallowed MIME type (“application/wasm”)
body: <p>I serve a static file server (through HTTP), which contains data generated by <code>wasm-pack</code>. Using the examples from the rustwasm book, I added this code to my index HTML page:</p>
  
  <pre><code>        &lt;script type="module"&gt;
              import init from "./pkg/fstree_web.js";
  
              async function run() {
                  await init();
              }
  
              run();
          &lt;/script&gt;
  </code></pre>
  
  <p>However, on Firefox, I get the error message as indicated in the title:</p>
  
  <blockquote>
    <p>module from “<a href="http://localhost:8000/pkg/fstree_web_bg.wasm" rel="noreferrer">http://localhost:8000/pkg/fstree_web_bg.wasm</a>” was blocked because of a disallowed MIME type (“application/wasm”).</p>
  </blockquote>
  
  <p>I suspected HTTPS issues or localhost issues, so I additionally tried <code>127.0.0.1</code>, and even tried an https://***.ngrok.io tunnel, and Firefox still rejects loading the wasm module with this error message.</p>
  
  <p>It links to an MDN article about X-Content-Type-Options, but I am not sure how it is relevant. My server is already sending <code>Content-Type: application/wasm</code>.</p>
  
  <p>The JavaScript code generated by wasm-pack starts with this:</p>
  
  <pre><code>import { __cargo_web_snippet_72fc447820458c720c68d0d8e078ede631edd723 } from './snippets/stdweb-bb142200b065bd55/inline133.js';
  import { __cargo_web_snippet_97495987af1720d8a9a923fa4683a7b683e3acd6 } from './snippets/stdweb-bb142200b065bd55/inline134.js';
  import { __cargo_web_snippet_dc2fd915bd92f9e9c6a3bd15174f1414eee3dbaf } from './snippets/stdweb-bb142200b065bd55/inline135.js';
  import { __cargo_web_snippet_1c30acb32a1994a07c75e804ae9855b43f191d63 } from './snippets/stdweb-bb142200b065bd55/inline136.js';
  import { wasm_bindgen_initialize } from './snippets/stdweb-bb142200b065bd55/inline293.js';
  import * as wasm from './fstree_web_bg.wasm';
  </code></pre>
  
  <p>Does Firefox want me to send *.wasm as a <code>application/javascript</code>? Or what is wrong?</p>