Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to load module script: The server responded with a non-JavaScript MIME type of "text/plain". Strict MIME type checking i

while building a debug toolbar in Django I am getting an error in file toolbar.js ie. s.map: HTTP error: status code 404, net:: ERR_UNKNOWN_URL_SCHEME toolbar.js:1 Failed to load module script: The server responded with a non-JavaScript MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.

can anyone tell me the possible fix for that?

like image 693
Nkgupta Avatar asked Sep 22 '20 16:09

Nkgupta


1 Answers

I found solution here How to set content type of JavaScript files in Django

#settings.py
if DEBUG:
    import mimetypes
    mimetypes.add_type("application/javascript", ".js", True)
like image 101
drewslee Avatar answered Oct 07 '22 19:10

drewslee