Site deploys fine, but resources are failing to load

Hi,

I have an issue, my website seems to build and deploy fine but when I visit it I received a blank screen. When I inspect element I receive 4 errors stating ‘Failed to load resource: the server responded with a status of 404 ()’. I understand that the page isn’t loading because it can’t be found but I don’t understand why it can’t be found.

Website: https://brave-easley-748991.netlify.app
GitHub: https://github.com/kairoberts/react_portfolio

Hi @kairob, welcome to the Netlify Community :wave:

I’m not seeing any 404 errors, just a blank page— opening the Dev Tools confirms that the request for the HTML returned with a 200 OK. What does appear to be failing to load are your JS and CSS files, though.

Since I don’t know what your build environment looks like I would double-check that the correct directory is being deployed and that any build artifacts are generated in the directory that will be deployed.

One way to check that things are where they’re supposed to be is visit the build page for your most recently deploy and click the download button next to the timestamp. This will download the directory that Netlify deployed so you can see what was actually pushed live.

Hope this helps, definitely feel free to respond with more questions if you have them.

Hi, @kairob. I just wanted to add a bit of detail to what @noelforte (because I can see the deployed files and he cannot).

This is an example URL your site is trying to find the files at:

https://brave-easley-748991.netlify.app/react_portfolio/static/css/2.92bfd6b7.chunk.css

However, the actual URL is:

https://brave-easley-748991.netlify.app/static/css/2.92bfd6b7.chunk.css

For some reason, your build is adding a react_portfolio to the file paths when it shouldn’t be there. This is from the HTML:

<link href="/react_portfolio/static/css/2.92bfd6b7.chunk.css" rel="stylesheet">

The correct href is this:

<link href="/static/css/2.92bfd6b7.chunk.css" rel="stylesheet">

If you can get this corrected with the site build, this will resolve the issue.

1 Like

@noelforte @Luke You were right, I had stupidly left “homepage” : “https://www.kairoberts.github.io/react_portfolio” inside my package.json because I tried to deploy through gh-pages originally, so that is why it was adding /react_portfolio/ within the build folder. Everything is now working as intended, cheers for the help gents I appreciate it.

1 Like