Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying React app to github pages. GET ... net::ERR_ABORTED

GitHub: https://github.com/Justin-Schneider/portfolio

Link to Page: https://justin-schneider.github.io/portfolio/

The Link brings up nothing and I get the following two Errors:

GET https://justin-schneider.github.io/portfolio/justin-schneider.github.io/portfolio/static/css/main.233e2870.css net::ERR_ABORTED
GET https://justin-schneider.github.io/portfolio/justin-schneider.github.io/portfolio/static/js/main.c60b5716.js net::ERR_ABORTED

npm run deploy executes correctly

package.json

{
"name": "my-website",
"version": "0.1.0",
"private": true,
"homepage": "justin-schneider.github.io/portfolio",
"dependencies": {
  "react": "^16.2.0",
  "react-bootstrap": "^0.31.5",
  "react-dom": "^16.2.0",
  "react-scripts": "1.0.17"
},
"scripts": {
  "deploy" : "npm run build&&gh-pages -d build",
  "start": "react-scripts start",
  "build": "react-scripts build",
  "test": "react-scripts test --env=jsdom",
  "eject": "react-scripts eject"
},
"devDependencies": {
  "gh-pages": "^1.1.0"
}
}
like image 258
J.Schneider Avatar asked Jan 31 '26 04:01

J.Schneider


1 Answers

"homepage": "."

This will Work!

As @Maksim Luzik have described the problem above.

We need to replace our URL in package.json with a '.' for the path.

For example :- This..

https://{username}.github.io/portfolio/justinschneider.github.io/portfolio/static/css/main.233e2870.css

will be...

./justinschneider.github.io/portfolio/static/css/main.233e2870.css

Hope you will get the idea.

like image 175
sudo01 Avatar answered Feb 02 '26 22:02

sudo01



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!