Skip to content
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

Site URL leads to an Error 404 page #137

Closed
mayank-mongia opened this issue Feb 23, 2023 · 3 comments
Closed

Site URL leads to an Error 404 page #137

mayank-mongia opened this issue Feb 23, 2023 · 3 comments
Assignees
Labels
awaiting-reply Awaiting an update / reply / response

Comments

@mayank-mongia
Copy link

mayank-mongia commented Feb 23, 2023

I created a react web app and deployed it using gh-pages.
When I am opening the published page, I am seeing a blank page.
Repository Link - https://github.com/mayank-mongia/notes-app
Published Link - https://mayank-mongia.github.io/notes-app/

@gitname
Copy link
Owner

gitname commented Feb 23, 2023

Hello @mayank-mongia, I noticed a few things I was surprised by:

  1. Letter casing differences:

    The homepage value in package.json ends with Notes-App (mixed case) but the repository name is notes-app (lowercase). The person who opened Capital letters in repo name might be an issue. #39 claimed that they encountered issues when using capital letters in their repository name. I have not tested/verified that yet. In your case, you're using capital letters in the homepage property; but it's something you can investigate since letter casing is involved in both situations.

    • I recommend you try changing the homepage value to be all lowercase. Also, if that does affect the result, please let me know as I would like to address it in the tutorial.
  2. Error 404 page, not blank page:

    The gh-pages branch of your repository does contain an index.html file in the root folder (✅), but visiting https://mayank-mongia.github.io/notes-app/ leads to an Error 404 page (i.e. it doesn't lead to a blank page for me).

    image

    For that reason, I suspect you have not fully configured GitHub Pages as described in Step 8: https://github.com/gitname/react-gh-pages#8-configure-github-pages.

    • I recommend you re-read that section and ensure your repository is configured accordingly.
  3. Old version of react-scripts:

    The version of Create React App used in your repository seems to be several years old, since it is using react-scripts version 3.2.0, which was released in 2019 (for reference, the current version is 5.0.1, which was released in 2022). When I wrote the current version of the tutorial, react-scripts was at 5.0.0 (as documented in the package.json file in this repository).

    • I recommend you use the latest version of Create React App instead. Although I don't think that is the reason for the Error 404 I'm seeing, I do think it will lead to hurdles in the long-term maintenance of your project.

Finally, I am "out of the office" right now (feeling ill 🤧), so may not respond promptly to future messages here, but I am interested in how things go for you.

@gitname gitname changed the title Blank page when opening a published react website Site URL leads to an Error 404 page Feb 23, 2023
@gitname gitname self-assigned this Feb 23, 2023
@gitname gitname added the awaiting-reply Awaiting an update / reply / response label Feb 23, 2023
@ManasiTilak
Copy link

ManasiTilak commented Mar 21, 2023

Hi @mayank-mongia , I had a similar issue. Try adding HashRouter to your index.js.

+ import { HashRouter } from "react-router-dom";

root.render(
  <React.StrictMode>
+    <HashRouter>
      <App />
+   </HashRouter>  
  </React.StrictMode>
);

After this try deploying your application again.

@gitname
Copy link
Owner

gitname commented Mar 28, 2023

Thanks, @ManasiTilak.

Closing because the original poster hasn't replied within 30 days.

@gitname gitname closed this as completed Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-reply Awaiting an update / reply / response
Projects
None yet
Development

No branches or pull requests

3 participants