Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(2 edits)

Hi @SanctumSanctorum,

Thank you for your detailed bug report!

It sounds like you’re encountering a MIME type issue with loading JavaScript module scripts. Specifically, you might see an error message like this in your browser:

Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of “text/plain”. Strict MIME type checking is enforced for module scripts per HTML spec.

If you are seeing this error, it may be related to how your system is configured to handle .js files. We use the mimetypes library to determine the MIME type, which reads data from your Windows registry.

Please check the following registry key:

HKEY_CLASSES_ROOT\.js

Ensure that the Content Type is set to application/javascript instead of text/plain. Make sure to back up your registry before making any changes.

To make it easier, here is a registry file you can use to set the correct values:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.js]
@="JSFile"
"Content Type"="application/javascript"
"PerceivedType"="text"

After updating this key, you won’t need to restart your PC; just restart the game, and everything should work fine.

If the issue persists or if the Content Type is already set correctly, please provide us with more details about the error.


Regarding why you didn’t encounter this issue in v0.5.8.74:

In that version, we used the following code:

<script src="/public/js/xxx.js" defer></script>

In later versions, we updated the code to:

<script type="module">
    import { XXX } from "/public/js/xxx.js";

This change may have introduced stricter MIME type requirements.

Thank you for your patience, and we look forward to resolving this issue!

Yep, this is exactly what the problem was. I changed the ContentType to application/javascript
 and everything is working great now.

Thanks so much for the help!

Hi @SanctumSanctorum,

I’m so glad to hear that the issue is resolved and everything is working great now!

If you have any more questions or need further assistance in the future, feel free to reach out. Thank you for your patience, and happy gaming!