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.

Visible directory structure on vercel instead of a 404

See original GitHub issue

Bug 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.

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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
vajajakcommented, Nov 6, 2020

I’ve experienced the same exact issue today. Running Next.js 10.0.0. Fix this, pleeease!

1reaction
ijjkcommented, Nov 24, 2020

Hi, this should now be updated, please re-deploy your application and give it a try!

Read more comments on GitHub >

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

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