Gh-pages 404 errors with deploy a react app #23646
-
I have 404 errors when I tried to deploy my react app to gh-pages. Here is my github - https://github.com/XAHTC/test-app/, and gh-pages - https://github.com/XAHTC/test-app/tree/gh-pages. It is a screenshot of errors: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
This is because their is no GitHub pages for your account. You will need to create a repository named |
Beta Was this translation helpful? Give feedback.
-
Hi @XAHTC, welcome to the GitHub Support Community! I’m not seeing those errors in your Pages site anymore, however it looks like they were caused by your asset URLs missing the When you’re deploying a React app to GitHub Pages there’s some steps you need to follow to make sure that everything works correctly—specifically adding the For exact steps I’d recommend reading over the documentation here: create-react-app.devDeployment | Create React Appnpm run build creates a build directory with a production build of your app. Set up your favorite HTTP server so that a visitor to your site is served index.html, and requests to static paths like /static/js/main..js are served with the contents of... |
Beta Was this translation helpful? Give feedback.
Hi @XAHTC, welcome to the GitHub Support Community!
I’m not seeing those errors in your Pages site anymore, however it looks like they were caused by your asset URLs missing the
test-app
repository name section.When you’re deploying a React app to GitHub Pages there’s some steps you need to follow to make sure that everything works correctly—specifically adding the
homepage
variable to yourpackage.json
file. This means that all your URLs include the required repo name.For exact steps I’d recommend reading over the documentation here:
create-react-app.devDeployment | Create React App
npm run build creates a build directory with a production build of your app. Set up your favorite HTT…