portfolio icon indicating copy to clipboard operation
portfolio copied to clipboard

Unable to load css after deploying to gh-pages

Open sharath29 opened this issue 3 years ago • 6 comments

repo: https://github.com/sharath29/portfolio

I have made few changes on top of your repo but after i ran the pre deploy and the scripts to deploy using gh-pages, I am not able to see any css or image being loaded to my web page.

webpage: https://sharath29.github.io/portfolio/

sharath29 avatar Mar 18 '22 13:03 sharath29

image

I'm not sure what CSS you are talking about. Can you explain more? As I can see it renders CSS and image.

hashirshoaeb avatar Mar 18 '22 17:03 hashirshoaeb

Hey! I had to manually correct this part to make it work. After the npm run predeploy it generates index.html which has src="/_next/...". I had to change this to src="_next/...". I am not sure if any setting is there to make sure the paths don't start with "/"

You can find more on this issue here:

https://stackoverflow.com/questions/52003005/css-not-working-on-github-pages

sharath29 avatar Mar 18 '22 18:03 sharath29

@sharath29 I am having the same issue with my page. I removed the slash but it still doesn't work. Is there anything else you did in a addition to removing '/'? Thanks! This is my page btw: http://hdianacardenas.com

hildidi avatar Apr 04 '22 22:04 hildidi

@hildidi that was the only change that I had to do, also please make sure you have the .nojekyle file as mentioned in this link:
https://stackoverflow.com/questions/61450307/js-and-css-not-loading-when-hosting-next-application-on-github-pages

sharath29 avatar Apr 05 '22 05:04 sharath29

Hmm, I think you are trying to publish manually. Well I have added this touch ./out/.nojekyll in my github workflow. I'll look into this.

hashirshoaeb avatar Apr 10 '22 04:04 hashirshoaeb

The headshot path is broken on github action run for forks, has a duplicate '/portfolio' in image path (e.g. in index.html it reads src="/portfolio/portfolio/_next/static/media/profile.34397709.png"). I was able to get images loading at least by removing this duplicate manually

navarchus avatar Jul 03 '22 20:07 navarchus