Does Next always deploy a /404 and /500 static route that are always available? #66329
Unanswered
tommhuth
asked this question in
App Router
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I noticed something unexpected on a project, where it looks like Next's default error pages for 404 and 500 are deployed as hard coded routes that can be access on root directly:
/500
and/400
both return the Nextjs default error pages together with their status code. This happens in a fairly large project where all routes are grouped under a[locale]
segment (this is also where the custom error pages are located).As I was debugging this I tried a simpler project (all static pages with no
i18n
), and here the 500 error page still shows up when going to/500
(see https://kompassterapeutene.vercel.app/500), but the 404 page does not give me the default 404 error page but my own custom 404 (cf to the previous project where it is always the default Next error styling).Is this to be expected? Should the error pages be moved to the root of the app folder to ensure it is used constantly? I tried this, and it made no difference for the first project mentioned.
Beta Was this translation helpful? Give feedback.
All reactions