Open RPGillespie6 opened 1 month ago
Related Issues and Documentation
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
We added the unfortunate exception after many different people reported it as a bug. This is the first report of a problem with .mjs.
Can you confirm that there is a registry setting on your machine overriding the default .mjs behavior? Do you know where that registry setting came from?
This is what I see in my registry:
If I delete the Content Type
and PerceivedType
entries, the mime type goes back to application/javascript
as expected.
I have no idea where that registry setting came from. At least 2 devs in my company had it set, while at least 1 didn't have it set. Kind of annoying that arbitrary windows apps can add these entries.
Note that it's not really that big of a deal if we don't fix this because I primarily develop in and deploy to Linux. This just came up recently when some devs were trying to run a go app under windows and getting all the javascript served as plain/text.
It's definitely not as common as .js, but it is common enough that big libraries often release a .mjs version of the library (for example: https://pixijs.download/v8.2.4/pixi.mjs). I created the issue in the off chance other windows users were affected by it, but I'm also fine with just closing the issue as "won't fix" with breadcrumbs to the workaround of amending your registry.
CC @neild.
Go version
1.21
What did you see happen?
This is identical to #32350 but .mjs instead of .js (I would have commented on the other thread, but it is locked to collaborators only).
.mjs is a fairly common javascript file extension for es modules (example: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules#aside_%E2%80%94_.mjs_versus_.js)
I'm wondering if it would be acceptable to implement the same workaround found here, but for .mjs?
i.e. I could submit a PR to do:
What did you expect to see?
.mjs files should not be served with
text/plain
due to misconfigured registry