I am getting whitescreen

Website URL


Error Message

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

Other Information

i uploaded code but i got white screen

It looks like your index.html file doesn’t have any visual HTML code in the body. Either that or the JavaScript module you’re trying to use is preventing it from being loaded by the web browser (likely due to the problem it’s having) What kind of script or module are you trying to use?


i made a simple portfolio using js and react and components like sidebar navbar hero etc inside appjsx, app jsx inside main jsx , main jsx inside html

1 Like

i just uploaded directly my js css codes

Apparently, our servers don’t recognize the file type .jsx, and so no Content-Type header is returned by the server. But it appears browsers are quite picky about getting the right Content-Type for Javascript modules and block if the content type is wrong.

Fortunately, you can declare your own Content-Types using .htaccess rules. So simply go to the htdocs folder of your site, find the file with the name .htaccess, or create one if it doesn’t exist, and add a line to the file like this:

AddType text/jsx .jsx

Then try reloading the page and see if that fixes anything.

I’m not sure if the text/jsx type is incorrect, I couldn’t really find what the correct content-type is supposed to be. If this doesn’t work, maybe application/javascript works instead.


From ChatGPT, there isn’t quite a standard.

The MIME type for JSX (JavaScript eXtension) files is typically “text/jsx” or “application/javascript”. JSX is commonly used in web development, especially with React, to write components that mix JavaScript and HTML-like syntax. The choice of MIME type may vary depending on the web server or platform you are using, but “text/jsx” and “application/javascript” are widely used for JSX files.


Do note that things may have changed from ChatGPTs cutoff date, don’t rely on it for accurate information.


Here’s a more official answer after some research.

Answer “text/jsx”.


didnt work ,i think infinityfree not supporting javascript nodejs etc

didnt work , i dont know what to do next.Tried all

I doubt you tried everything. Setting the type to text/jsx didn’t fix it, but application/javascript did work.

However, when defining it as Javascript, it returned an error because the current code is not valid Javascript code.

We don’t have Node.js on our servers, but Javascript runs in the browser, so it can be hosted pretty much anywhere.

I just realized something: you appear to have a React app. But did you actually build the React code before uploading it?

You appear to have uploaded a node_modules folder and a package.json that contain build instructions on how to build a React app. But since our servers don’t have Node.js, those files are just served as-is without any processing.

If you want to host a React site with us, you can do that without any problem, but you must build the React project locally first (with NPM), and upload the generated files to your hosting account.

After you’ve done so, you’ll also want to get rid of the node_modules on your hosting account. It serves no purpose other than wasting disk space and inodes.


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