gh-pages: Build files not found net::ERR_ABORTED 404

Probably this is common. I get 404 to all my build files.

Gh-pages will not find my files from create-react-app inside the build folder. I’ve tried moving them out, which has worked before. I manually renamed them this time but still not being found.

Actual place: https://github.com/chrisdel101/baseballhack/blob/gh-pages/static/css/main.56da8e78.chunk.css Where gh-page is looking: https://chrisdel101.github.io/static/css/main.56da8e78.chunk.css

Spent a few hours on this now including following all the orthodox steps in CRA deployment tutorials.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 13
  • Comments: 21

Commits related to this issue

Most upvoted comments

You need to set the “homepage” key in package.json. For example:

“homepage” : “http://yourgithubname.github.io/yourreponame",

hey I was having the same trouble using vue but found this while googling so I’ll share this in case anybody else does. In my case the problem was that the minimized index.html on dist had all the <link> and <script> tags pointing to a subfolder that didn’t exist <script src="vue-app-folder/js/chunk-vendors.a81e0c23.js"></script>

so I just changed it like this <script src="./js/chunk-vendors.a81e0c23.js"></script>

and now everything works, probably my fault because of something that I did at some point but hope that helps

For me, the problem was that it wasn’t properly navigating the folder structure. not working version:

    <script type="module" crossorigin src="/assets/index-43cca805.js"></script>
    <link rel="stylesheet" href="/assets/index-7a3c4c5b.css">

working version:

    <script type="module" crossorigin src="./assets/index-43cca805.js"></script>
    <link rel="stylesheet" href="./assets/index-7a3c4c5b.css">

Add a “.” before the “/assets/…” part and the error will go away

I had to manually do this. I don’t know how to get react to build it correctly

< base href=“./” >

I didn’t. I wasn’t able to use GH pages and instead made a server and used Heroku for that project. Every time I use GH pages with create-react-app, which is common, it’s a crapshoot whether I will be able to deploy it or not. Sometimes it works and sometimes it doesn’t. I haven’t figured out why yet so I can’t reproduce the error.