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

430
Vistas
Can't access my pages by URL, only by links in next js

I have an application built with next JS. It works fine in development, but when published to the internet, I have a problem. The only way I can access the pages in the application are by the links on the home page, that link to those pages. For example, I get a 404 error if I type in www.example.com/about, but if I click the link that routes to it, everything is fine.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

I couldn't comment because of my experience point. Could you share your code for higher components/pages? For now what I understand is your browser can't fetch the data before render, so you get an error. It' is a wild guess but maybe you can add a condition to your components(for example for url/about let's say you render about() component) that

if (!data){ return <div>Loading</div>}  

This is an approach that I used at React apps(never used next) but since they are quite similar it might help you.

about 4 years ago · Juan Pablo Isaza Denunciar

0

I was also having a similar problem.

Configuring the trailingSlash in next configuration worked for me.

In the root of your project in next.config.js try adding:

module.exports = {
  trailingSlash: true,
}
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