reactjsgithubdeploymentgithub-pages

Blank page when using custom domain in github pages


After reading other posts, changing some things and then others I am unable to visualize my website. My current settings are:

function App() {
  return (
    <Routes>
      <Route index path="/projectjs" element={<Home/>}></Route>
      <Route ...

At my index.js file I have:

root.render(
  <BrowserRouter basename={process.env.PUBLIC_URL}>
    <AuthProvider>

Then in my package.json I have:

{
  "homepage": "https://app-name.com/",
  "name": "app-name.com",

Here is also my github pages settings:

git hub pages settings

I have changed all things around with no success, anyone can tell me what's wrong? The DNS looks ok due it is loading a blank website but with the website title at the tab.


Solution

  • You seem to be using React. Github Pages isn't usually used for hosting a React app because of its static nature.

    However, here is a tutorial on how to do it. It might be a good starting point for your issues.

    Vercel is a more popular option for free react hosting.