- Server: Python/Flask
- OS: Ubuntu 18.04
- Vanilla JS
<script
type="module"
src="{{ url_for('static', filename='js/app.js') }}"
></script
I have included this script tag at the bottom of the body in the html. For some reasons, when I run the server locally with flask run, I the following error message in browser console:
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.
Why is the loading the wrong MIME-type. I am not even sure if there are more details that are relevant. I will do my best to fill in the blanks as best as I can.