Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load css after deploying to gh-pages #4

Open
sharath29 opened this issue Mar 18, 2022 · 6 comments
Open

Unable to load css after deploying to gh-pages #4

sharath29 opened this issue Mar 18, 2022 · 6 comments

Comments

@sharath29
Copy link

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/

@hashirshoaeb
Copy link
Owner

image

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

@sharath29
Copy link
Author

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

@hildidi
Copy link

hildidi commented Apr 4, 2022

@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

@sharath29
Copy link
Author

@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

@hashirshoaeb
Copy link
Owner

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.

@navarchus
Copy link

navarchus commented Jul 3, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants