Github pages not displaying my vite.js website #10575
-
Describe the bugOnce i push to my github and then go to the pages feature on github where github generates a link for my web app, the screen is white and i get this error: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. I am running a react app created with Vite.js locally and everything works perfectly when i run npm run dev. It should do the same when github generates a link for my website Reproductionhttps://github.com/claudeMassaad/TENZIES-GAME-REACT-APP Steps to reproduceNo response System InfoSystem:
OS: macOS 10.15.7
CPU: (4) x64 Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
Memory: 1.42 GB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 16.17.0 - /usr/local/bin/node
npm: 8.15.0 - /usr/local/bin/npm
Browsers:
Chrome: 106.0.5249.119
Safari: 15.6.1 Used Package Managernpm LogsNo response Validations
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
I guess you published the source instead of dist. You'll need to run |
Beta Was this translation helpful? Give feedback.
-
Didn't work. Any other solution |
Beta Was this translation helpful? Give feedback.
-
Hi everyone! There's the code and I've tried running build and deploying, also checking the sources on the html, but I just don't get it and I've been stuck with it for a couple weeks now: Failed to load resource: the server responded with a status of 404 () Any help is very much appreciated. |
Beta Was this translation helpful? Give feedback.
I guess you published the source instead of dist. You'll need to run
npm run build
and publish the generateddist
directory.See https://vitejs.dev/guide/static-deploy.html#github-pages for more details.