0

I uploaded my React site to GitHub under the repo jschlte.github.io it displays a blank page with the error of "Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/jsx". Strict MIME type checking is enforced for module scripts per HTML spec". But on Netlify the site loads up just fine.

GitHub Pages: https://jschlte.github.io/
Netlify: https://jschlte.netlify.app/

My package.jsonenter image description here

My vite.config.js file enter image description here

My main.jsx file enter image description here

1 Answer 1

1

This github page only host static website. If you develop your web based on Reactjs, you need to translate your codes to pure html/css/js by using tool like webpack. In your case, you only need to npm run build and deploy again to your github repo. Then everything will work.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.