Disallowed MIME type Error

Today I am trying an example of 3D graphics under javascript. It did not work, and when I checked the web console, I saw the following error:

Loading module from "http://cascade.local/resources/threejs/r122/build/three.module.js" was blocked because of a disallowed MIME type ("text/html"). example.html Loading failed for the module with source "http://cascade.local/resources/threejs/r122/build/three.module.js".

screen capture of disallowed error message

This error does not make sense. Why would text or html be disallowed? I looked on-line for help, but did not find anything relevant. I was able to figure out the problem, which is a minor error. The biggest problem here is that the error message is misleading; it has nothing to do with the actual problem. Below is the line with the problem:


    <script type="module">
    import * as THREE from '../resources/threejs/r122/build/three.module.js';
The REAL problem is that the file does not exist, or at least it's not at that location. Here's the fixed version.

    <script type="module">
    import * as THREE from '../three_ex2/resources/threejs/r122/build/three.module.js';
See the difference? There is no "resources" directory one level up, but there is a directory called "three_ex2/resources" one level up.


-M. Weeks, April 8, 2021