-
Notifications
You must be signed in to change notification settings - Fork 941
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
Code is deployed, but page is blank #3
Comments
Hi @indrawanadjie, thanks for providing your Node.js, NPM, and CRA version numbers. I haven't tested the process with such recent versions of any of those things. Before I setup a system with those version in an attempt to reproduce the behavior you reported, will you post (1) the contents of your I would like to examine both of those things, to look for clues as to what the underlying problem is. |
Hi @gitname thanks for your reply.
Result only display favicon and title on top. Site link here: https://fit-dev.github.io/pimol-fb-react/ Thank you.. |
Maybe it won't work if you have it private ? |
Hi @indrawanadjie, Thanks for providing all the information I requested. I visited the URL you provided (labeled "site link" in your previous comment) and examined it using the React Developer Tools extension for Google Chrome. I saw that, in addition to the Favicon and Page Title, there are, indeed, some React elements on the page. One is shown in the screenshot below. For that reason, I think the deployment process worked (i.e. GitHub Pages is serving a built version of your app). Here's what I think is happening: I think there is something in your app, itself, that is causing it to not appear when hosted on GitHub Pages. For example, I noticed your app uses React Router. GitHub Pages serves your app from a non-root folder (i.e. I wonder whether React Router does not consider your app's URL as a match for any of the routes defined in your app. For example, if you define a route using I recommend you look into the |
Hi @dangpro-1210, the deployment process has worked for me with both public and private GitHub repos. I appreciate you bringing up that detail, though, just in case. |
I will close this Issue because I think the issue lies in the app's configuration of React Router, not in the deployment process. @indrawanadjie, did you add the |
same here for a few minutes then it loaded with my 404 after heading home works fine I think adding basename prop to the BrowserRouter will solve landing on 404. thanks @gitname |
In my case it was a typo on the homepage URI on package.json make sure to copy the URI from the browser to be sure that it's correct. |
Solved it for me too! Woohoo! Thank you! |
Yes!! Thank you for this! It worked for me with the |
Adding |
Since my app only has one path, I was able to get it working for both GitHub pages and local development ( <BrowserRouter basename={window.location.pathname || ''}>
<Route exact path="/" component={Index} />
</BrowserRouter> |
That fixed my issue as well. Thanks. |
Well. Not always works. In my case I preferred to put the basename with the name or variable of subfolder. With your solution when you reload the webpage takes de last path and add the same again path. |
All users using Github Page to deploy their react-router based app should read this issue! |
This fixed my issue, Thanks a lot💛 |
I dont know if anyone else is still having this issue, but I was having trouble hosting my website on /docs folder and i made the env.public part global and it somehow worked for me. like this: Also if anyone is doing the same way as I am like hosting or debugging on docs folder you gotta follow the exact steps:
doing these worked for me. |
This works for me. It helps me to get out to this issue. Thanks Bro! @bonniesimon |
Can you help me, because i have same problem, i have only one path and my app shows blank page, where should i put this : |
Awesome. This works for me as well. Thank you! |
I didnt use any router , but it still is showing blank, site:address 👍 |
I have different Routes but this seems to work for me as well. |
@kumar303 Thanks My Issue Resolved Successfully after trying 12 hours. |
this's great! tnx a lot bro... |
THANKSSSSSSSSSS |
Wow!!!!!!!!! Thanks a lot. It works finally |
I have more than one paths i guess that's why it doesn't work for me. How should i apply this code? |
Working fine now... Hoooo.... 🥳 |
thank you so much it works for me bundle of thanks , i have use this basename attribute as well as add homepage attribute in your package.json file the deployed website url in homepage than create build it works for me |
Add "basename" attribute in BrowserRouter like this |
I was also facing the same problem while deploying Blogify to Code was deployed and but the link when opened showed white blank page. The homepage was also set correctly Also, I was using react-router extensively and had multiple paths like After scraping the internet, did this little change in the BrowserRouter component
i.e., added basename={process.env.PUBLIC_URL} prop to the BrowserRouter component. FYI : process.env.PUBLIC_URL is a part of the node.js library and is a dynamically generated URL that changes based on what development mode you are in, whether you are working on your app locally, or on an actual production server like |
THANK YOU this needs to be somewhere more visable |
Do you know how to preview a react project on GitHub pages? I follow the instructions here https://github.com/gitname/react-gh-pages but it did not work |
I added basename and it's not working in my case. Please need help |
This one worked for me thanks :)`` |
|
Thanks It worked for me! |
|
Useful package, i already follow you instruction. But i got blank page
The text was updated successfully, but these errors were encountered: