I got this on Firefox (FF58). I fixed this with:
- It is still experimental on Firefox (from v54):
You have to set to true the variabledom.moduleScripts.enabled
inabout:config
Source: Import page on mozilla (See Browser compatibility)
- Add
type="module"
to your script tag where you import the js file
<script type="module" src="https://stackoverflow.com/questions/42237388/appthatimports.js"></script>
- Import files have to be prefixed (
./
,/
,../
orhttp://
before)
import * from "./mylib.js"
For more examples, this blog post is good.