Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

203
Views
Why does my GitHub page only show the homepage for my react app and not the other pages?

So Im trying to deploy my weather app to GitHub Pages and I have installed gh pages as well as added the web link to homepages in my package.json file. But when I go on the live site, it only shows the homepage and not the other "subpages" I have. If I click on the cities on top to get to that page, it shows a 404 error. What should I do??

This is the link I have in package.json: "homepage": "https://mw3981.github.io/Weather_App/"

enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

My initial thought is that you have a disconnect between what the router is expecting and how Github pages serves pages from within a repo.

Github always wants to have "/Weather_App/" at the start of the path. (so the homepage is "https://mw3981.github.io/Weather_App/")

The router in react isn't expecting this, so when it tries to serve a subpage it's trying to go to "https://mw3981.github.io/subpage" instead of what github is expecting: "https://mw3981.github.io/Weather_App/subpage"

Try adding/using basename the prop mentioned here.

Also, there may be some compatibility issues between Github Pages and how the router is doing page changes via pushState. That's discussed here.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!