This content originally appeared on DEV Community and was authored by Emily Feng
GitHub Pages does not support JSX or modern ES6 modules directly.
If deploying to GitHub Pages, don't forget to build first.
Here are some useful tutorials I followed to solve this problem. (Huge thanks to the authors)
Note: deploy pages from gh-pages branch, some vites when running npm run build change build to dist, to account for this do "deploy": "gh-pages -d dist".
Deploying a React App
For Single Page Apps (Fixing Refresh 404 Problems)
This content originally appeared on DEV Community and was authored by Emily Feng
Emily Feng | Sciencx (2025-02-25T22:17:49+00:00) How to Host React Webpages on Github Pages. Retrieved from https://www.scien.cx/2025/02/25/how-to-host-react-webpages-on-github-pages/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.