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

429
Views
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 answers
Answer question

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 Report

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 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!