404 error when using useFileSystemPublicRoutes = false
See original GitHub issueWhen 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:
- Take
custom-server
example - Replace
const app = next({ dev })
inserver.js
withconst app = next({ dev, conf: { useFileSystemPublicRoutes: false } })
- There’s now no route for /
- Start the server, hit localhost:3000
- Server serves 404 (it flashes for a moment), then client takes over and re-renders
/pages/index.js
component. Browser console containsWarning: 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:
- Created 6 years ago
- Reactions:12
- Comments:24 (17 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
also seeing the same problem, any updates on this issue? thanks
#4008