Cannot get my full react site to deploy.
I dont know exactly what is causing it, i got this errors when i open the console.
Failed to load resource: the server responded with a status of 404 () main.1c194c19.css:1
Failed to load resource: the server responded with a status of 404 () main.61b2c80a.js:1
Failed to load resource: the server responded with a status of 404 () manifest.json:1
Failed to load resource: the server responded with a status of 404 () main.1c194c19.css:1
Failed to load resource: the server responded with a status of 404 () manifest.json:1
Manifest: Line: 1, column: 1, Syntax error. manifest.json:1
here is a link to my netlify site:
https://glistening-truffle-77e9d5.netlify.app
here is a link to the github repository, the branch is “v13”
https://github.com/JulianSantiagoPico/HighPerformance
I used gh-pages to see it properly in the github pages (it works there), maybe its something related to that.
Any help would be greatly appreciated!
@HellBlaze As you’ve spotted the issue is that none of your assets are loading.
This is very much the case.
When people host on gh-pages their project is configured to build as if hosted in a subfolder, in your case /HighPerformance/
.
But on Netlify they want to serve from the root as /
.
You can see that all the asset references in your output on Netlify contain /HighPerformance/
:
But the files aren’t in those locations:
https://glistening-truffle-77e9d5.netlify.app/HighPerformance/static/js/main.61b2c80a.js
They’re here:
https://glistening-truffle-77e9d5.netlify.app/static/js/main.61b2c80a.js
When you run your Build command it actually says this:
As it advises, you can control this with the homepage
field in your package.json
.
See:
{
"name": "highperformance-app",
"version": "0.1.0",
"homepage": "https://juliansantiagopico.github.io/HighPerformance/",
"private": true,
"dependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@emailjs/browser": "^4.1.0",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@fontsource/roboto": "^5.0.8",
"@mui/icons-material": "^5.14.13",
"@mui/material": "^5.14.13",
"@testing-library/jest-dom": "^5.17.0",
You can set that to /
or remove it entirely for hosting on Netlify.
2 Likes
Thank you so so much, im new to netlify and didnt new how to solve this. I appreciate it very much
<3
Matin
January 7, 2025, 3:04pm
4
Thanks, Nathan. It solved my problem by removing the homepage
from package.json
file and totally getting rid of gh-pages because Netlify handles it as long as we’ve linked our website to the corresponding GitHub repo.