.mjs mimetype support
See original GitHub issue.mjs ECMA Script Module files are served with application/octet-stream
MIME Type
instead of text/javascript
, so the modules do not get imported in Chrome because of this error:
:8080/counter.mjs:1 Failed to load module script: The server responded with a non-JavaScript MIME > type of “application/octet-stream”. Strict MIME type checking is enforced for module scripts per HTML spec.
Can you serve these files with the correct mime type please? Sounds like a pretty minor change 😃
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:6 (3 by maintainers)
Top Results From Across the Web
61383 – (MJS) *.mjs files should be part of mime text/javascript
Server admins have full power over their mime.types, and if they need their servers to support this, they don't have to wait for...
Read more >JavaScript ES6 Module basic question: .mjs file extension and ...
mjs files with a MIME type of plain text, rather than as JavaScript. Here's a simple example: Default.html: <!doctype html> <html> ...
Read more >Common MIME types - HTTP - MDN Web Docs
Extension Kind of document MIME Type
.aac AAC audio audio/aac
.abw AbiWord document application/x‑abiword
.arc Archive document (multiple files embedded) application/x‑freearc
Read more >2216 (Add .mjs to known JS MIME types) - Nginx.org
.mjs is supported by Node. ... It is also supported by various existing MIME databases and serves properly on various hosts like Github...
Read more >support es modules .mjs file with mime-type application ...
so http server who determine content-type via file extension should support .mjs avoid to be content-type: octet-stream. the mime type for ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is there currently a way to declare custom MIME type mappings? If so, can somebody please a) document it in the README, or b) explain it briefly here so I can write up a PR with improved docs?
This appears to be fixed on
master
, please re-open if this is not the case.