Site name: ewan-stott-portfolio-deploy2
Description: My site is working on github hosting (here: Ewan Stott ). Now trying to host on Netlify, and site says successfully published, but does not load.
Github repo here: GitHub - ewanstott/home: Personal website/portfolio. Built using React and Bootstrap.
Console Errors:
main.fe927caf.css:1
Failed to load resource: the server responded with a status of 404 ()
main.70b145b7.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 ()
manifest.json:1 Manifest: Line: 1, column: 1, Syntax error.
main.fe927caf.css: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 ()
Thanks in advance
@ewanstott Your issue is common for people that initially host on GitHub then try to host on Netlify.
On GitHub you’re producing the site so it’s hosted in a sub-folder, but on Netlify you’re deploying that folder to the root.
If you view source on the page you will see all your asset paths begin with /home/
:
The files don’t exist in /home/
:
https://ewan-stott-portfolio-deploy2.netlify.app/home/static/js/main.70b145b7.js
They exist here:
https://ewan-stott-portfolio-deploy2.netlify.app/static/js/main.70b145b7.js
If you run your build locally with npm run build
you will see a note that your output has been created to be hosted at /home/
and that you can adjust it with the homepage
value in your package.json
.
Since you want to host from /
on Netlify, just delete the entire homepage
declaration in your package.json
:
{
"name": "developers-portfolio",
"description": "A personal static website/portfolio template hosted with GitHub Pages, built to showcase my recent projects.",
"homepage": "https://ewanstott.github.io/home",
"version": "2.0.0",
"dependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^13.5.0",
"axios": "^0.27.2",
"bootstrap": "^5.2.0",
"sass": "^1.54.3",
"react-typist-component": "^1.0.3",
"react": "^18.2.0",
1 Like