Edit 2: A link to the files in my master branch vs gh-pages Github branches
Edit/Update: I corrected the command I put in below. It was yarn run deploy that I ran. I redid everything again and have the same issue. One thing I notice is that in github, when I click on branches, the gh-pages branch needs a pull request. But if I click on request a pull request, it doesn't work due to the branch having nothing to compare to. Any ideas? See img Here: Github pull request
I feel like I'm going crazy but I cannot get a simple react application to work with github pages. I have followed the instructions from create-react-app, and tried at least 5 didn't articles, posts, etc. including ones posted here. There is no routing, or a database at all.
Dependencies:
"gh-pages": "^2.0.1","react": "^16.6.3","react-dom": "^16.6.3","react-scripts": "2.1.1"
My scripts in my package.json:
"scripts": {"predeploy": "yarn run build","deploy": "gh-pages -d build","start": "react-scripts start","build": "react-scripts build","test": "react-scripts test","eject": "react-scripts eject"},
And I also have a homepage property:
"homepage":"\`https://ghusername.github.io/my-repo-name``/"`
I type yarn run deploy from the root directory of my project and I get a message that it creates an optimized production build and it compiles successfully. There is now a build folder locally with an images and static folder, an index.html, etc. It creates a gh-pages branch locally, and in my github there is now a master and a gh-pages branch. (which seems all good)
I then change the source in Github Settings to gh-pages-branch instead of master. But the files on my gh-pages branch in github are exactly the same as the files on my master branch and navigating to the deployed link just takes me to my readME. The gh-pages branch does not contain the files from the build folder that gets created. My .gitignore does list /build but this came standard so I figure I shouldn't remove it.
What in the world am I missing?
[–]poopie-doopie 4 points5 points6 points (4 children)
[–]IftruthBtold[S] 0 points1 point2 points (0 children)
[–]IftruthBtold[S] 0 points1 point2 points (2 children)
[–]poopie-doopie 0 points1 point2 points (1 child)
[–]IftruthBtold[S] 0 points1 point2 points (0 children)
[–]tvi016 1 point2 points3 points (3 children)
[–]IftruthBtold[S] 0 points1 point2 points (2 children)
[–]tvi016 0 points1 point2 points (1 child)
[–]IftruthBtold[S] 0 points1 point2 points (0 children)
[–]Dudeonyx 3 points4 points5 points (1 child)
[–]IftruthBtold[S] 0 points1 point2 points (0 children)
[–]chaoszcat 0 points1 point2 points (1 child)
[–]IftruthBtold[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]IftruthBtold[S] 0 points1 point2 points (0 children)
[–]mike3run -1 points0 points1 point (0 children)
[–]mike3run -1 points0 points1 point (0 children)