I get Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
after importing axios
into a javascript file.
Based on: ES6 modules in local files - The server responded with a non-JavaScript MIME type
I though that all I had to do is to run my code on a server (e.g. http://127.0.0.1:8080/) instead of on the file system (e.g. file:///C:/Users/...
).
I did that by downloading http-server
with npm
and ran everything on the above server--but I still get that error.
Edit:
Failed import statement import axios from './node_modules/axios';