I am following this youtube-tutorial to make my first html5-canvas game: https://www.youtube.com/watch?v=4q2vvZn5aoo&t=5133s. At 59:10 he says you can use vs code to fix my problem, but he doesn't say how, and then proceeds to show how it's done on a mac. Here is my question:
When i import an image using this line of code in the Javascript-document:
import platform from "./Canvasgame.img/platform.png" ("platform" is the object i want to add the image to), it gives me this error:
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "image/png". Strict MIME type checking is enforced for module scripts per HTML spec.
I use the live-server extension on vs code, and i link to the javascript-document as a module-type: <script src="Canvasgame.js" type="module"></script>. I don't understand why it doesn't let me import the image.