I’m following instructions from https://github.com/gitname/react-gh-pages to deploy my react app to github pages.
At the link I’m getting a blank page though and a 404 error:
Failed to load resource: the server responded with a status of 404 ()
My app works on local host
I searched around and its likely my homepage link that is wrong?
link to my repo: https://github.com/PatgioK/pathfindingvisualizer
link to the app: https://patgiok.github.io/pathfindingvisualizer/
here is my package.json:
JavaScript
x
44
44
1
{
2
"name": "pathfindingvisualizer",
3
"version": "0.1.0",
4
"private": true,
5
"homepage": "https://patgiok.github.io/pathfindingvisualizer/",
6
"dependencies": {
7
"@testing-library/jest-dom": "^5.14.1",
8
"@testing-library/react": "^11.2.7",
9
"@testing-library/user-event": "^12.8.3",
10
"gh-pages": "^3.2.3",
11
"react": "^17.0.2",
12
"react-dom": "^17.0.2",
13
"react-scripts": "4.0.3",
14
"save-dev": "0.0.1-security",
15
"web-vitals": "^1.1.2"
16
},
17
"scripts": {
18
"predeploy": "npm run build",
19
"deploy": "gh-pages -d build",
20
"start": "react-scripts start",
21
"build": "react-scripts build",
22
"test": "react-scripts test",
23
"eject": "react-scripts eject"
24
},
25
"eslintConfig": {
26
"extends": [
27
"react-app",
28
"react-app/jest"
29
]
30
},
31
"browserslist": {
32
"production": [
33
">0.2%",
34
"not dead",
35
"not op_mini all"
36
],
37
"development": [
38
"last 1 chrome version",
39
"last 1 firefox version",
40
"last 1 safari version"
41
]
42
}
43
}
44
Advertisement
Answer
Try specifying the branch in the deploy script by adding -b SomeBranchName
in your packages.json.
so:
JavaScript
1
5
1
"scripts": {
2
,
3
"deploy": "gh-pages -d build -b SomeBranchName",
4
5