Search code examples
reactjsgithubgithub-pages

Github Pages website (React) shows blank page


I have a React website (https://github.com/sousa16/sousa16.github.io) which I'm trying to deploy with Github Pages (https://sousa16.github.io/), but it only shows a blank page. I've attached my App.js and my package.json. I have tried to find out what's wrong by analyzing the browser console (on inspect) of my website, but I can't seem to figure out what's wrong. I have been at this for days, all help is welcome, thanks for the attention in advance.

App.js

package.json

browser inspection

I have changed basename on BrowserRouter, inspected the browser console errors (don't understand them), changed homepage on package.json, all with no result.


Solution

  • <HashRouter> is for use in web browsers when the URL should not (or cannot) be sent to the server for some reason. This may happen in some shared hosting scenarios where you do not have full control over the server.

    Deploying on Github is one scenarios where you do not have full control over the server so you have to use HashRouter instead of BrowserRouter