-
Hi All, I tried to build a personal website following a template and the website worked perfectly locally. However, after I deployed it to GitHub Pages, I can only see a blank page. I checked the Javascript console and here is the error message: Failed to load resource: the server responded with a status of 404 () Does anyone have any clue why “https://jiayibao.github.io” is repeated twice in loading the resource? Here is my github repository: https://github.com/jiayibao/personal-site/ And here is the personal webpage that is currently showing blank: https://jiayibao.github.io/personal-site/ My suspect that the error has something to do with path, but I’m not really sure about how to fix it. Any help would be greatly appreciated! Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 27 comments 12 replies
-
Thanks! In fact, this problem has been solved by the person who provided me the inital website template. Thanks for the input! |
Beta Was this translation helpful? Give feedback.
-
Can you please share the solution with us? Even though my name is not getting repeated in the HTTP request link but I feel I am facing a similar issue as you did. :slight_smile: |
Beta Was this translation helpful? Give feedback.
-
I am also facing same problem, this is my website in react https://meghanar121.github.io/covid-19/ |
Beta Was this translation helpful? Give feedback.
-
I had the same issue too. I just started react (newbie on react). Here is how I fixed it. I went into the index.html file that I uploaded (aside from the fact that github made it so difficult and not user friendly to upload) I simply used the web edit on github and made live changes. link href="/static/css/main.a124****.chunk.css" or script src="/static/js/2.22a******.chunk.js Therefore, And where ever your code calls js or css or whatever, you will need to add your repo name infront. Good luck if you have a huge website. Maybe you should add before uploading |
Beta Was this translation helpful? Give feedback.
-
@AndreaGriffiths11 GitHub Pages is already configured. But it is showing loading error. PF the below attachments. |
Beta Was this translation helpful? Give feedback.
-
I also faced the same issue, my website works great while locally and shows a blank page after deployment on live server. I got the hint to sort out this issue by testing react app. I imported React from react in my two components of the app, after that it works fine on the live server too. |
Beta Was this translation helpful? Give feedback.
-
I resolved that problem, try it: go to index.html in your compiled code, for example in Angular is “dist/index.html” and paste that: if you already have it, then delete and replace that line. |
Beta Was this translation helpful? Give feedback.
-
@sjPrajwal this was react app i made mistake in package.json file, homepage should have proper address |
Beta Was this translation helpful? Give feedback.
-
hey, please help me as I am facing the same problem as yours. |
Beta Was this translation helpful? Give feedback.
-
Hi @jiayibao, Thanks for being here! To have your repository show up at https://username.github.io/your-repository, you need to setup GitHub Pages for that repository as well. Ie: your repo should be USERNAME.github.io and its URL ( https://github.com/USERNAME/USERNAME.github.io ). I hope this helps! |
Beta Was this translation helpful? Give feedback.
-
Hi application link Thanks |
Beta Was this translation helpful? Give feedback.
-
A little late to the party, but if anyone is using Vite with React and are trying to deploy to GitHub Pages then follow this article. After you follow everything and redeploy your code, you may have to fiddle on GitHub a little by saving page deploy to another branch and then going back to gh-pages or you may just have to be patient. Hopefully this helps! |
Beta Was this translation helpful? Give feedback.
-
I solved this issue. It was very simple … but I tried more than 3 hours 🤣
just dot before / |
Beta Was this translation helpful? Give feedback.
-
@AndreaGriffiths11 github page configuration. |
Beta Was this translation helpful? Give feedback.
-
thanks alot you saved my life. |
Beta Was this translation helpful? Give feedback.
-
Just in case someone is still having the same problem. I replaced https with http in the homepage property in package.json, and then it just works. |
Beta Was this translation helpful? Give feedback.
-
Help me to deploy app |
Beta Was this translation helpful? Give feedback.
-
@meghanar121 can you please suggest solution for this…? even i am facing same problem… |
Beta Was this translation helpful? Give feedback.
-
If anyone still struggling with this like I just did, my solution was simple - in index.js, change BrowserRouter like this:
Important note: I noticed that even after redeploying with changes, the page was still referring to old code, and I only realized this after I tried to add react independent changes. I ended up deleting the repository and creating a new one, but that shouldn't be necessary, just make sure your fixes are actually applied. Might be some caching problem |
Beta Was this translation helpful? Give feedback.
-
For any one experiencing similar problem, try to create a action that generates a static site to deploy from the branch works for me ✌️ |
Beta Was this translation helpful? Give feedback.
-
In my case, my website was loading a 404 next error page, but using next.js, my index page inside the pages directory was called "Index.ts" which resulted in a "Index.html" file, and next couldn't locate the index.html page. I changed directly into the public branch ( which is my deploy branch ) to "index.html" and it worked |
Beta Was this translation helpful? Give feedback.
-
I think it's a bug in github or compatibility is not good enough, I don't understand why gihub hasn't dealt with this problem yet, this problem is very misleading and makes developers think it's their problem so much that they waste a lot of time. Until gihub has a good solution, the ideal solution is to use vercel or netlify |
Beta Was this translation helpful? Give feedback.
-
This worked for angular as well just added repo link and added repo name infront of js files |
Beta Was this translation helpful? Give feedback.
-
I also had the same kind of issue. |
Beta Was this translation helpful? Give feedback.
-
This looks like it might be a case sensitivity issue. Your Pages site is hosted from a repository called
Can you try setting this to t he following instead and seeing if it makes a difference?
|
Beta Was this translation helpful? Give feedback.
-
Not sure why, but this worked for me: setting the GitHub Pages source to a different branch and then setting it back to the gh-pages branch (or whatever branch you deployed to). |
Beta Was this translation helpful? Give feedback.
-
I have the solution for Angular! On your index.html in the your build doc, ajuste the base href="link" If your link is href="https://user-name.github.io/" add your repo name in the end of this, like: from: to: In the index.html of your build page. |
Beta Was this translation helpful? Give feedback.
Thanks! In fact, this problem has been solved by the person who provided me the inital website template. Thanks for the input!