Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Github Pages Deploy ERR_ABORTED 404 (Not Found)

I'm trying to deploy my create-react-app here But I'm getting these error. static/css/1.e03ed13c.chunk.css net::ERR_ABORTED 404 (Not Found). I have no any chunk.css file. What is a problem? Can you help me?

My package.json

{
  "homepage": "http://ebrugulec.com/image-text-detection",
  "name": "image-text-detection",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "axios": "^0.18.0",
    "filepond": "^3.5.0",
    "filepond-plugin-image-preview": "^3.1.4",
    "react": "^16.6.3",
    "react-autosize-textarea": "^5.0.1",
    "react-dom": "^16.6.3",
    "react-dropzone": "^7.0.1",
    "react-filepond": "^5.0.0",
    "react-scripts": "2.1.1",
    "superagent": "^4.0.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "predeploy": "npm run build",
    "deploy": "gh-pages -d build"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not ie <= 11",
    "not op_mini all"
  ],
  "devDependencies": {
    "gh-pages": "^2.0.1"
  }
}
like image 705
Ebru Gulec Avatar asked Dec 15 '18 21:12

Ebru Gulec


2 Answers

I solved this issue by adding


"homepage" : "https://myblog-url",

in 'package.json' file in my react-app project directory

xxx.chunk.js and xxx.chunk.css file is in 'build/static/' directory

and when I went to network tab of developer tools of chrome and saw the exact error messages,

I was able to find url my browser was going to access, and in my case, the url of my blog was different from what I meant to be.




like image 77
Sam Avatar answered Sep 28 '22 18:09

Sam


I was able to resolve the problem by adding Adding "homepage": "." to package.json.

like image 35
jake Avatar answered Sep 28 '22 18:09

jake