# Javascript MIME Type Error

**URL:** <https://forum.infinityfree.com/t/javascript-mime-type-error/106094>\
**Category:** Hosting Support\
**Created:** [February 17, 2025, 8:48am UTC](https://forum.infinityfree.com/t/javascript-mime-type-error/106094 "2025-02-17T08:48:05Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![dejames13](https://forum.infinityfree.com/letter_avatar/dejames13/32/5_5575768a8748004e209b776fc1b2916d.png) [@dejames13](https://forum.infinityfree.com/u/dejames13)\
**Post date:** [February 17, 2025, 8:48am UTC](https://forum.infinityfree.com/t/javascript-mime-type-error/106094/1 "2025-02-17T08:48:05Z")

</div>

### Website URL

[https://dashboard-test.infinityfreeapp.com/index.html](https://dashboard-test.infinityfreeapp.com/index.html)

### Error Message

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

### Other Information

When i go to the file by typing the directory, it forces me to download the index-.js file for some reason.

also i alread did this (with also text/javascript) as well as the react app that i uploaded is built

AddType application/javascript .js  
AddType application/json .json

---

<div class="post-metadata">

**Author:** ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)\
**Post date:** [February 17, 2025, 11:49am UTC](https://forum.infinityfree.com/t/javascript-mime-type-error/106094/2 "2025-02-17T11:49:49Z")

</div>

Judging by the error message, it seems that your Javascript file has the MIME type `module/javascript`. But that doesn’t seem like a real MIME type, and not something our server should respond with.

I checked your website and I don’t see any errors like that there. Can you please share the full link to the file for which the server responds with the bad MIME type?

---

<div class="post-metadata">

**Author:** ![dejames13](https://forum.infinityfree.com/letter_avatar/dejames13/32/5_5575768a8748004e209b776fc1b2916d.png) [@dejames13](https://forum.infinityfree.com/u/dejames13)\
**Post date:** [February 17, 2025, 12:41pm UTC](https://forum.infinityfree.com/t/javascript-mime-type-error/106094/3 "2025-02-17T12:41:12Z")

</div>

wydm, the root of the website is literally white screen because of the error.  
[https://dashboard-test.infinityfreeapp.com/](https://dashboard-test.infinityfreeapp.com/)  
i routed the react folder with the htaccess and it renders, but for some reason it cant load the main index file causing the white screen. is there a file size limit or anything?

Another weird thing is that it makes me download the index file when I look at it. its like the server is treating it a downloadable binary

[http://dashboard-test.infinityfreeapp.com/assets/index-CN6AZF3y.js](http://dashboard-test.infinityfreeapp.com/assets/index-CN6AZF3y.js)

 ![image](https://forum-cdn.infinityfree.net/original/3X/7/8/78165b79155c264adae9e39f4c194a57b71c127c.png)

---

<div class="post-metadata">

**Author:** ![JavesPotato](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/javespotato/32/53167_2.png) [@JavesPotato](https://forum.infinityfree.com/u/JavesPotato)\
**Post date:** [February 17, 2025, 2:49pm UTC](https://forum.infinityfree.com/t/javascript-mime-type-error/106094/4 "2025-02-17T14:49:08Z")

</div>

I didn’t see the error on your website. I found other problems, though.

- ~~The webpage will be rendered empty when visited without the `https` protocol~~ ( **Edit** : Probably it’s because of the network cache).
- CORS problem was detected from a certain network request (i.e: http:://localhost/api/charts/v1).
- ~~The `index.html` page does not work. A 404 error is being emitted from the page. The website will only work if you try to access it without `/index.html` at the end of the URL~~ ( **Edit** : The `.htaccess` file might have caused it).

* * *

> [@dejames13](#):
>
> is there a file size limit or anything?

Yes, a 10MB limit was imposed on every file. The file is going to be deleted if the size reaches beyond the limit. However, that was not the reason why the page got rendered empty. Let’s assume that the file has been deleted due to a violation of the file size. Unless you had changed the default 404 page provided by Infinityfree with your own, you should not have seen an empty page in the first place.

> [@What is the file/upload size limit](https://forum.infinityfree.com/t/what-is-the-file-upload-size-limit/49308):
>
> On all InfinityFree servers is a file size limit of 10 MB. It’s important to note that this is a file size limit and not an upload limit. The difference is subtle, but important. An upload limit could be set through PHP settings, but this limit is enforced on the file system level. No PHP configuration can override this limit and it applies to files uploaded through FTP or the file manager as well. Can the limit be increased? No. The size limit is fixed and cannot be increased in any way. 10 M…

> [@Why are my files deleted after uploading them](https://forum.infinityfree.com/t/why-are-my-files-deleted-after-uploading-them/49310#p-192755-the-file-exceeds-the-file-size-limit-4):
>
> Sometimes, when you upload a file, the upload is completed but the file is deleted immediately afterwards. This is usually caused by one of the following issues: The file is not in a htdocs folder All websites files must be uploaded to either the main htdocs folder, or to the domain specific htdocs folder (like example.com/htdocs). You cannot upload files to other directories on your account. If you try to create or upload files anywhere else, they will be deleted automatically. The file type…

---

<div class="post-metadata">

**Author:** ![lovebug](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/lovebug/32/57624_2.png) [@lovebug](https://forum.infinityfree.com/u/lovebug)\
**Post date:** [February 18, 2025, 3:23am UTC](https://forum.infinityfree.com/t/javascript-mime-type-error/106094/5 "2025-02-18T03:23:42Z")

</div>

Trying to access your localhost server isnt going to work

`The Same Origin Policy disallows reading the remote resource at http://localhost:8000/api/charts/bar1`

---

<div class="post-metadata">

**Author:** ![dejames13](https://forum.infinityfree.com/letter_avatar/dejames13/32/5_5575768a8748004e209b776fc1b2916d.png) [@dejames13](https://forum.infinityfree.com/u/dejames13)\
**Post date:** [February 20, 2025, 6:49am UTC](https://forum.infinityfree.com/t/javascript-mime-type-error/106094/6 "2025-02-20T06:49:18Z")

</div>

It was working now thanks, apparently i just have to wait for my website to refresh after adding SSL certificate to it. also the CORS error was intended as i was just trying to see if my react will be rendered along side a server

---

<div class="post-metadata">

**Author:** ![dejames13](https://forum.infinityfree.com/letter_avatar/dejames13/32/5_5575768a8748004e209b776fc1b2916d.png) [@dejames13](https://forum.infinityfree.com/u/dejames13)\
**Post date:** [February 20, 2025, 6:51am UTC](https://forum.infinityfree.com/t/javascript-mime-type-error/106094/7 "2025-02-20T06:51:10Z")

</div>

Yes, i forgot to change it in my env file when i was building it, but it isnt what im testing, i was just trying to see if I can render my react app along with the server. Ill change the env config once im sure its working, thankss

---

<div class="post-metadata">

**Author:** ![JavesPotato](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/javespotato/32/53167_2.png) [@JavesPotato](https://forum.infinityfree.com/u/JavesPotato)\
**Post date:** [February 20, 2025, 6:57am UTC](https://forum.infinityfree.com/t/javascript-mime-type-error/106094/8 "2025-02-20T06:57:12Z")

</div>

I didn’t know you’re building a website for a university! Good luck!

---

<div class="post-metadata">

**Author:** ![dejames13](https://forum.infinityfree.com/letter_avatar/dejames13/32/5_5575768a8748004e209b776fc1b2916d.png) [@dejames13](https://forum.infinityfree.com/u/dejames13)\
**Post date:** [February 21, 2025, 3:25am UTC](https://forum.infinityfree.com/t/javascript-mime-type-error/106094/9 "2025-02-21T03:25:12Z")

</div>

yess, its my part time as student, Thanks for your reply btw its a huge help! ive been trying to figure it out so i can try on actual cpanel

---

<div class="post-metadata">

**Author:** ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)\
**Post date:** [February 28, 2025, 3:25am UTC](https://forum.infinityfree.com/t/javascript-mime-type-error/106094/10 "2025-02-28T03:25:46Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
