Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "application/octet-stream". Strict MIME type checking is enforced for module scripts per HTML spec

Hi, I have a netlify site that succesfully deployed but i’m getting this error - Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of “application/octet-stream”. Strict MIME type checking is enforced for module scripts per HTML spec. This is my site URL -
https://uncovermusic.netlify.app/
I think its worth mentioning that i’m using typescript and React, my index.html looks like this


Thank you.

Hi, I fixed it by going deep enough in the other support threads.
My build command is vite build nor npm run build and the publish directory is dist.

Now this is if you’re using Vite.

You can start by sharing your site name so other can check your site.

1 Like

Hi there

While I was learning I have recently built my react app using vitejs.dev framework.
In my dev environment its launching and running perfectly but when I am deploying here on Netlify it deploys successfully but on launching site it ends with a blank page.

With the error message:

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

My site link is : https://moviedatabase78.netlify.app/

My github Project link : Yasmin-Walid/Capstone-Project- at 2d2913d9f2999fdb265169c38ac2d1f9bf6edc59

Before asking for help I tried many alternative solution shared by other community members but none worked for me.

Here is the build logs

Please help me, I don’t get what I am doing wrong

Thanks
Yasmin

Publish directory should probably be dist.