I'm running a website on localhost:8000 and I'm currently in an infinite loop for fixing this problem. This is the line for using the javascript file in my html file:
<script type="text/javascript" src="./scripts/main.js"></script>
I set the type to "text/javascript" because I got this error: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". According to this post I had to change type="module" to type="text/javascript", which fixed the error indeed, but then I got a new error: Uncaught SyntaxError: Cannot use import statement outside a module. According to this post I need to use type="module" and now I'm in a infinite loop.
package.json:
{
...
"main": "main.js",
"type": "module",
...
If the console no longer throws a module related error, I'd guess that the infinite loop problem is related to the code itself.