Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain" error after deploying on netlify custom domain from github

Hello, I developed a react JS website using Vite and appwrite for the backend which is running perfectly on localhost but when I am trying to host on Netlify it gives me the following error

“main.jsx:1 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.”

I have tried to clear browser cache, mobile, laptop, different networks, different browsers, etc but doesn’t work at all.

I bought a custom domain on Hostinger and changed the required settings to use Netlify DNS which showed successful on Netlify, but now is am getting this annoying error constantly. When I am checking the content type in the network it shows a content type of text/plain. Please help me resolve this error as this is for production.

Website Link:- rishi-bhumi.com

Update:- The website worked perfectly after writing this post but for no reason automatically the problem started to occur again.

Hi @SM0718, thanks for your post and welcome to the Netlify Support Forums.
I just visited your site and it displays perfectly at my end without any errors. I want to find out if the problem persists or not.

Thanks.

1 Like

Yes, It now works perfectly although i am facing a different problem, changes make to my github repo is not getting automatically deployed.

1 Like

@SM0718 Things to check:

  1. Confirm the site you’re looking at actually is connected to the git repository (and branch etc) that you’re updating.

  2. Confirm you don’t have a locked deploy

Edit: Thanks for deleting the separate topic you created.

1 Like