I'm trying to develop javascript that uses the three.js package, and I'm stuck at an early step of trying to import a module. In the html, I have
<script src="main.mj"></script>
And then in main.js I have
import * as THREE from './js/three.module.js';
But, my browser won't load the page, giving the error "Uncaught SyntaxError: Cannot use import statement outside a module". If I change the html code to read
<script src="main.mj" type=module></script>
Then I get
"Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec."
import * as THREE from './js/three.module.js';
I am pretty new to javascript, and I'd appreciate any advice. I'm editing on a local maching running an nginx webserver on localhost.