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. errors.infinityfree.net/errors/404/:1
Failed to load resource: the server responded with a status of 404 ()
Download.html:106 Uncaught ReferenceError: handleFileSelection is not defined
at HTMLInputElement.onchange (Download.html:106:95)
Does infinityfree support module js I mean file with .mjs extension which is running nicely on local machine but not on infinityfree server
I’m afraid not. .mjs files are for Node.js, and InfinityFree only supports client-side Javascript, not server-side. However, it is supported on iFastNet if you upgrade to Premium.
If it’s for personal use, use render or vercel to deploy your project. Both supports server-side and static files, provides free subdomain too. Check my website https://uploadspeedcalculator.onrender.com
MJS files are basically just Javascript files, but with a little bit different implication for how they are used in browsers. MJS files can be used with Node.js but can also be used in browsers.
But that’s not really relevant. The important part is that the error message you get refers to our 404 error page, which probably means that the .mjs file being references just can’t be found.
Seeing how your HTML file is called Download.html, please note that our servers, like almost all hosting servers, are case sensitive. So if the file casing is different, that might explain why it works on your own computer but not here.
But just for completeness sake, it might also be that the server just doesn’t recognize the file type .mjs. To make sure that the server properly identifies the .mjs files, you could try adding the following line to your .htaccess file: