Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Deployed React app to github pages is blank

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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:

{
  "name": "pathfindingvisualizer",
  "version": "0.1.0",
  "private": true,
  "homepage": "https://patgiok.github.io/pathfindingvisualizer/",
  "dependencies": {
    "@testing-library/jest-dom": "^5.14.1",
    "@testing-library/react": "^11.2.7",
    "@testing-library/user-event": "^12.8.3",
    "gh-pages": "^3.2.3",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-scripts": "4.0.3",
    "save-dev": "0.0.1-security",
    "web-vitals": "^1.1.2"
  },
  "scripts": {
    "predeploy": "npm run build",
    "deploy": "gh-pages -d build",
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

>Solution :

Try specifying the branch in the deploy script by adding -b SomeBranchName in your packages.json.

so:

"scripts": {
    ...,
    "deploy": "gh-pages -d build -b SomeBranchName",
    ...
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading