DEV Community

Discussion on: How to deploy React App to GitHub Pages

Collapse
 
oliverwatkins profile image
Oliver Watkins

This doesn't work for me at all. I get a 404 Error.

Are you sure there isn't another step you are missing?

My package.json has this :

"name": "shape-shop-frontend",
"homepage": "oliverwatkins.github.io/alpenhof",

I have connected to my remote repository here :

github.com/oliverwatkins/shape-sho...

And then I have run

"npm run deploy"

Are you sure there you don't have to create some io repository? In the github pages it says something about creating an "io" repo :

.github.io

Collapse
 
eimert profile image
Eimert Vink

Hello everbody,

I fixed the 404: "I ran into this problem myself and finally discovered a simpler solution. The problem is that Jekyll ignores all files that start with _. The simple solution is to add a .nojekyll file to your docs dir."

Here's how:
git checkout gh-pages
mkdir docs/
touch docs/.nojekyll
git push origin gh-pages

And a redeploy:
npm run deploy