everyone. I'm really new to Javascript — just starting to learn, really. I've got a simple HTML file I want to run below.
<!DOCTYPE html>
<html>
<head>
<script type="module">
import anime from "../node_modules/animejs/lib/anime.es.js";
anime({
targets: 'div',
translateX: 250,
rotate: '1turn',
backgroundColor: '#FFF',
duration: 800
});
</script>
</head>
<body>
<div></div>
</body>
</html>
I am trying to use anime.js, run its "hello world" script. I have it downloaded to my computer, to the directory seen above. I am running this html through live-server, so I don't have to deal with CORS issues.
However, every method I try to import this module doesn't work. I always get "Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec" in the Chrome console whenever I try to serve this html page. To make matters weirder, whenever I attempt to click the anime.es.js:1 link Chrome returns, in the applications tab it shows me my HTML file above.
Have I missed a specific step here, or something?