question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

404 error when using useFileSystemPublicRoutes = false

See original GitHub issue

When useFileSystemPublicRoutes is set to false and there is no custom route for path, but page-based route exists, nextjs will render that page on client instead of 404.

Steps to reproduce:

  1. Take custom-server example
  2. Replace const app = next({ dev }) in server.js with const app = next({ dev, conf: { useFileSystemPublicRoutes: false } })
  3. There’s now no route for /
  4. Start the server, hit localhost:3000
  5. Server serves 404 (it flashes for a moment), then client takes over and re-renders /pages/index.js component. Browser console contains Warning: React attempted to reuse markup

So with this option behavior on server and client is not consistent, and it doesn’t look like it should work this way.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:12
  • Comments:24 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
TonyHYKcommented, Jan 22, 2018

also seeing the same problem, any updates on this issue? thanks

0reactions
timneutkenscommented, Mar 14, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

404 error when using useFileSystemPublicRoutes = false #2682
When useFileSystemPublicRoutes is set to false and there is no custom route for path, but page-based route exists, nextjs will render that page ......
Read more >
Next.js useFileSystemPublicRoutes:false doesn't work with ...
But when i use slug, it doesnt work and get 404. Actually when i run "npm run dev" it works but when i...
Read more >
Error 404: 4 Ways to Fix It - Hostinger
Error 404 is a response code, meaning the server could not locate the requested content. Check this article to learn 4 steps to...
Read more >
Error 404 not found - What does it mean & how to fix it! - IONOS
Your browser displays the error message 404 Not Found instead the desired web page? The solution is easy - an HTTP 404 error...
Read more >
What Is a 404 Error? How to Deal With the Web Error
A 404 error indicates that the webpage you're trying to reach can't be found, and usually means that the page has moved or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found