Custom 404 page won't overrule default 404 page in Next pages router

40 Views Asked by At

So I have been trying to create custom 404 page as usual in Nextjs. I have followed the official Next.js documentation on custom 404 pages for Pages Router to create a custom 404 page but whatever random url I type in I can't display the custom 404 page it always falls back to the default 404 page.

I also use an embedded Sanity Studio in my project where they (Sanity) recommended to place the Sanity Studio in the app folder (App Router) as a sole element even when I use pages router.

Is have an incremental adoption (as mentioned here) the cause of the issue?

I followed exactly the exact guide for pages router and I even deleted the .next folder, restarted Vscode, used other function names. Nothing seems to work.

I also checked on the issue board and also Discord but couldn't find any infos related to this issue.

0

There are 0 best solutions below