Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

206
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda