Loading module was blocked because of a disallowed MIME type

Viewed 3109

I am getting Loading module from “http://localhost:3000/d3.js” was blocked because of a disallowed MIME type (“”) when trying to import d3.js library. The project uses npm and the error has been encountered in Firefox.

index.html

<!DOCTYPE html>
<html lang="en">
  <header>
    <meta charset="utf-8" />
    <title>D3</title>
  </header>

  <body>
    <div id="svg"></div>
    <script src="./index.js" type="module"></script>
  </body>
</html>

index.js

import * as d3 from "./d3.js";
0 Answers
Related