/src/main.jsx:1 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

Here is my netlify site. Am using Node js React and vite as the build tool. The project has two folders a client and server folder. The server folder is hosted in render.com and client is hosted on netlify. Here is the link

https://wonderful-jelly-a64f23.netlify.app/

I keep getting this error :

/src/main.jsx:1 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.

i have even run npm run build and am using dist as the publish directory but the error is still persistent. Help me resolve this issue

You should try that again, as you’re provably deploying source files:
https://wonderful-jelly-a64f23.netlify.app/README.md
https://wonderful-jelly-a64f23.netlify.app/package.json

Make sure to set your Build settings correctly.

Your build should run and you should deploy your output, not your source.

Note that once you’ve changed your Build settings you need to run the build again for them to take effect.

Thanks alot the solution worked. Turns out when I build the app the dist folder was listed in gitignore file thus no changes would happen when i commited

@lithium It’s normal for the dist folder to be in the .gitignore, there’s no need to have the build output in the repository, as it gets produced when the build occurs.

You would only have the build output in the repository if you weren’t building on Netlify, if you were building locally for example, committing the build output, then having Netlify deploy that without building.

glad to hear your solution worked!

the same thing is happening to me and I dont understand what I have to do I am not using a dist file its just uploading straight from my github repo

the link:
https://emerse.netlify.app/

Change publish path to dist: Build & deploy | Site configuration | emerse | Netlify

like this?

No. Don’t set anything in package path. Rest is good.