0

I have an issue that I have blank page my react app contains multiple sites and I using browse router and when the site is deployed I see blank page

Browse router:

<Router>
        <Route path="/DAPP-identity-management" element={<Main />} />
        <Route
          path="/DAPP-identity-management/authorize"
          element={<Authorize />}
        />
        <Route path="/DAPP-identity-management/info" element={<Info />} />
      </Router>

Home page setup:

"homepage": "https://Xardesso.github.io/DAPP-identity-management/",

Scripts:

"scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "predeploy": "npm run build",
    "deploy": "gh-pages -d build"
  },

Link to page:https://xardesso.github.io/DAPP-identity-management/

I tried to add base name but this don't help.And also changed browseRouter to HashRouter doesn't help

EDIT:This doesn't help versions "react": "^18.2.0" "react-router-dom": "^6.13.0" And also I found error in homepage line "homepage": "https://Xardesso.github.io/DAPP-identity-management",Error:

`Problems loading reference 'vscode://schemas/settings/configurationDefaults': Unable to load schema from 'vscode://schemas/settings/configurationDefaults': cannot open vscode://schemas/settings/configurationDefaults. Detail: Unable to resolve text model content for resource vscode://schemas/settings/configurationDefaults.`
Community
  • 1
  • 1
  • Does this help answer your question? https://stackoverflow.com/questions/71984401/react-router-not-working-with-github-pages/71985764#71985764 If not please explain in greater detail what the issue is, including the versions of `react-router-dom` and `react` you are using. – Drew Reese Jun 20 '23 at 01:44
  • FWIW I see this error when loading that page: "TypeError: Cannot read properties of undefined (reading 'pathname')". I see that you have a `Router` component, which router is it? It should be the `HashRouter`. Also, the routes should be rendered within a `Routes` component. Can you [edit] to include a better [mcve]? – Drew Reese Jun 20 '23 at 01:47
  • I modified post – Marcin Łętowski Jun 20 '23 at 12:06
  • Sorry, did ***you*** edit the post to include the "EDIT: ...." text blurb, or did the community bot really do that? There were a couple rendering issues in RRDv6.12.0 and v6.12.1, that were supposedly 1 or the other was going to be addressed in the v6.13.0 release. See this [post](https://stackoverflow.com/questions/76466318/react-router-link-not-working-in-production) for some details and link to the github issue which seems related to the issue you describe seeing in your app. You can try an older version, say RRDv6.11.x, to see if that resolves the blank screen issue. – Drew Reese Jun 20 '23 at 16:18
  • I changed version "react-router-dom": "^6.11.2", and still page is blank ``` } /> } /> } /> ``` and homepage ``` "homepage": "https://Xardesso.github.io/DAPP-identity-management", ``` github repo https://github.com/Xardesso/DAPP-identity-management – Marcin Łętowski Jun 20 '23 at 20:26
  • If you inspect your app, well, the URL when it loads, it appears the `
    ` element doesn't have the app injected into it. How are you building the app? Are there any errors when building the app? Also, FWIW, I think all your routes should omit the `"/DAPP-identity-management"` path prefix since this is already part of the URL where the app is being hosted/served from.
    – Drew Reese Jun 21 '23 at 05:37
  • You were right the path shouldnt contain "/DAPP-identity-management" the right version should look like this} /> Thx for help – Marcin Łętowski Jun 21 '23 at 13:24

0 Answers0