Next.js Discord

Discord Forum

Not found page doesn't work in production

Unanswered
Honzosaurus_3.1415926535 posted this in #help-forum
Open in Discord
So I have a pretty new portfolio website that uses NextJS with the app dir and when I'm runnig it locally, my not-found.tsx works fine, but when I deploy the app to Vercel, it just completely stops existing, which causes me to be able to visit any route and if it's a 404 then the home page will be displayed.

4 Replies

Tonkinese
To confirm, you are following this strucutre? https://nextjs.org/docs/app/api-reference/file-conventions/not-found
And nothing seems to work so far: the only thing I see as a solution would be to force the 404 page thru the middlreware, but there has to be another way right?