-
-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*.cjs
extension files served as text/plain
#355
Comments
Running into this as well. Looks like this issue has been reported in 2020 in #268. |
As a workaround, I am using the |
#364 sounds like an easy merge 🥹 Can we get this done? |
This is still an issue as of February 2024. unpkg.com/three (direct link https://unpkg.com/three@0.161.0/build/three.cjs) throws up a nosniffer error and is being read as "text/plain." |
I was working off of this statement when I sent the PR, but am not sure it's accurate. I don't think Chrome will treat |
This is still an issue. As you can see with this packages: https://unpkg.com/browse/@revealbi/ui@0.2.0/ The
|
@brianlagunas Unfortunately, it looks like It doesn't look like the SPONSORS.md file has been updated for even longer suggesting that, despite its popularity, it might not have the funding necessary to continue to be maintained. This is all purely speculation, of course, and I hope that the project is updated and maintained going forward! #364 was opened about a year ago and it was approved a couple months later, but there's been no movement since. |
@Potherca described a workaround in the other issue (as well as above) for the time-being. Appending the |
Modern Node.js modules can be served as ESMs or CommonJS modules. These are differentiated either by their
package.json
, or by the extension of the file. It appears thatunpkg
properly serves.mjs
files, but seems to treat*.cjs
files as plaintext incorrectly.Instead of
text/plain
, thecontent-type
of.cjs
files should beapplication/javascript
.Node's documentation can serve as reference for the honoring of these files: https://nodejs.org/api/modules.html#enabling
The text was updated successfully, but these errors were encountered: