Next.js Discord

Discord Forum

Custom error/404 page on pages router does not override default error/404 page

European Starling posted this in #help-forum
Open in Discord
European StarlingOP
Same question asked here

doing exactly what the docs say ( and yet incorrect route always gives the default 404 page rather than the pages/404.tsx file that I made. Going to /404 shows it.

Renaming it to not-found.tsx stops the default one being shown but breaks the page. I think 'not-found' is something for the app router ( rather than pages router so probably not correct thing to do but makes me suspicious that nextjs isn't doing what it's supposed to.

1 Reply

European StarlingOP
downgrading next from 14 to 12 fixed it. however, this is not a solution. I think NextJS themselves need to fix this bug.