Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

205
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda