Home > OS >  Javascript Modules not working on some clients
Javascript Modules not working on some clients

Time:05-15

I recently started using Javascript modules in my websites, and everything was fine when developing on my desktop. I went to do work on my laptop, but for some reason JS is throwing the following error:

Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.

Both of my machines are on the latest version of Windows 10 and Brave browser. Google doesn't have anything, and I am out of ideas. My best guess is some weird browser version issue, but I cant find anything about it.

CodePudding user response:

Answer:
This is an issue with the http server I was using. My version of Python's http server on my laptop doesnt support modules. this post fixed my issue.

Also why do I have to wait 2 days to mark this as an answer?

  • Related