question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.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:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
thw0rtedcommented, Dec 3, 2019

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?

0reactions
thornjadcommented, Aug 7, 2021

This appears to be fixed on master, please re-open if this is not the case.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found