Skip to content

Blank Page after deployment #159

Open

Description

@cap-oglu

After, i git clone my repository in another PC and make some changes on the code and run "npm run deploy" i saw blank page.
I tried everything and read the previous issues but could not find the solution.
The website works in local.

Category

Which of these applies to you? (Select all that apply)

Links

Tell us where we can find your code and your GitHub Pages site:

Everything else

The console error:
image

The homepage property:
image

The blank page:
image

...

Activity

  1. koushikromel commented on Aug 25, 2023

    @koushikromel

    Yes facing the same issue. Hope we'll get a reply...

  2. Yuskhosmith commented on Oct 3, 2023

    @Yuskhosmith

    I am facing the same issue, I think it is caused by the React Router, I have deployed this same repo using gh-pages without react router, now I decided to update it and viola, blank page and 404s

  3. jmanuelmartinez commented on Oct 5, 2023

    @jmanuelmartinez

    Same issue here. I have followed the instructions but after deploy my user site, it shows only a blank page.

  4. jmanuelmartinez commented on Oct 5, 2023

    @jmanuelmartinez

    Hey guys! Good news!

    I found the issue #152 and after ran "npm run build" and then "npm run deploy" the site has been deployed succesfully.

    Therefore is not a routing error but a build one.

    Hope it helps. My site is now running as expected.

  5. Yuskhosmith commented on Oct 5, 2023

    @Yuskhosmith

    Hi,

    So, I just tried it again, still the same issue, #152 mentioned that predeploy script isn't running because of yarn but I am certain that my predeploy script ran and it published. I would like to know if you're using react router as well, maybe this is as a result of code structure or something @jmanuelmartinez

  6. jmanuelmartinez commented on Oct 6, 2023

    @jmanuelmartinez

    Hey!

    I'm not using react router, maybe that could be the reason.

  7. jmanuelmartinez commented on Oct 6, 2023

    @jmanuelmartinez

    Hello!

    I have added react router to my project to try new things and it is giving me blank page. So going seems to be related to the project structure or how the react-gh-pages handles that routing. I will investigate more :(

  8. Yuskhosmith commented on Oct 6, 2023

    @Yuskhosmith

    Alright, I have tried #132 structure by adding Browser Router to Index.js and not app.js, but it didn't work, that might be a good place to start as the PR is about react router, which is evidence that people have used it with react router :)

  9. jmanuelmartinez commented on Oct 6, 2023

    @jmanuelmartinez

    Hi, I have found that the cause of routing not working in GitHub Pages is that it does not allow browsing history. However, if you implement HashRouter instead of BrowseRouter, it works.

    ReactDOM.render( <React.StrictMode> <HashRouter> <App /> </HashRouter> </React.StrictMode>, document.getElementById('root') );

    Hope it helps!

  10. Yuskhosmith commented on Oct 12, 2023

    @Yuskhosmith

    Hi, I have found that the cause of routing not working in GitHub Pages is that it does not allow browsing history. However, if you implement HashRouter instead of BrowseRouter, it works.

    ReactDOM.render( <React.StrictMode> <HashRouter> <App /> </HashRouter> </React.StrictMode>, document.getElementById('root') );

    Hope it helps!

    This works, thanks 🫱🏾‍🫲🏾

  11. jmanuelmartinez commented on Oct 12, 2023

    @jmanuelmartinez

    Glad it works!

  12. llariola00 commented on Nov 16, 2023

    @llariola00

    Hi, I have found that the cause of routing not working in GitHub Pages is that it does not allow browsing history. However, if you implement HashRouter instead of BrowseRouter, it works.

    ReactDOM.render( <React.StrictMode> <HashRouter> <App /> </HashRouter> </React.StrictMode>, document.getElementById('root') );

    Hope it helps!

    Thanks a lot! Fixed mine too. 😁

  13. GurpreetSingh-Projects commented on Nov 28, 2023

    @GurpreetSingh-Projects

    Facing Same Issue, my old build had no router at all, but after adding react router, whoosh

  14. jmanuelmartinez commented on Nov 29, 2023

    @jmanuelmartinez

    Glad it worked out!

  15. Tathya551 commented on Dec 7, 2023

    @Tathya551

    Hi, I have found that the cause of routing not working in GitHub Pages is that it does not allow browsing history. However, if you implement HashRouter instead of BrowseRouter, it works.

    ReactDOM.render( <React.StrictMode> <HashRouter> <App /> </HashRouter> </React.StrictMode>, document.getElementById('root') );

    Hope it helps!

    Thank you very much, was stuck here since 2 days, read countless articles yet nothing worked, this worked...!!!

  16. JosephBARBIERDARNAL commented on Mar 28, 2024

    @JosephBARBIERDARNAL

    Worked for me too!
    Additional info for those who made the same mistake than me: make sure to don't put the HashRouter twice (like one in App.js and one in index.js), otherwise changing from Browse to Hash will have no impact

  17. AbdulrahmanZaki commented on Sep 3, 2024

    @AbdulrahmanZaki

    I have the same problem but I'm just using html, css, and js. sometimes it shows me the content of the readme file

  18. added a commit that references this issue on Aug 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions