Visible directory structure on vercel instead of a 404
See original GitHub issueBug report
Describe the bug
There is an inconsistency between the dev environment and vercel with the 404 page and the directory listing
On application that have a dynamic route /[locale]/foo
. And staticly generate two routes: /fr/foo
& /en/foo
.
As expected, all the following urls are returning a 404 pages in development:
- ✔
/it/foo
- ✔
/fr/bar
- ✔
/fr
- ✔
/baz
On vercel environment the path /fr
does not show a 404 pages but list the directory content.
- ✔ https://csb-gg6n3-4laukaxm8.vercel.app/it/foo
- ✔ https://csb-gg6n3-4laukaxm8.vercel.app/fr/bar
- ❌ https://csb-gg6n3-4laukaxm8.vercel.app/fr
- ✔ https://csb-gg6n3-4laukaxm8.vercel.app/baz
I’ve created a reproduction repository: https://github.com/Spy-Seth/nextjs-directory-listing-and-404-inconsistency
To Reproduce
You can use this codesandbox: https://codesandbox.io/s/focused-snyder-gg6n3
Expected behavior
I expect a 404 pages in all these cases.
System information
Version of Next.js: 9.5.2
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Directory Listing – Vercel Docs
When enabled, the Directory Listing will be displayed. When disabled, a "Not Found" error will be displayed with status code 404 .
Read more >Project Config with vercel.json
A complete reference for Vercel project configurations using vercel.json. ... will get a 404 error when visiting a route configured with cleanUrls locally....
Read more >Custom 404 Page – Vercel Docs
Emit a 404.html file to your Output Directory and it will be served as the 404 page when a route does not match...
Read more >File System API (v2) – Vercel Docs
Learn how to integrate with Vercel's File System API. ... Functions might depend on for execution. Those can be included via Bundling Configuration...
Read more >REST API – Vercel Docs
Allows to retrieve the file structure of a deployment by supplying the deployment unique ... It'll respond with a 404 if the request...
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
I’ve experienced the same exact issue today. Running Next.js 10.0.0. Fix this, pleeease!
Hi, this should now be updated, please re-deploy your application and give it a try!