Menu

We call notFound() four times and never wrote the page it lands on, and the default has zero links
📰

We call notFound() four times and never wrote the page it lands on, and the default has zero links

DEV Community: react·Daniel Pertu·17 days ago
#b0Vu8AID
#devtoreact#devto#dev#fafafa#error
Reading 0:00
15s threshold

Notifio is a desktop app that watches rental search pages and tells you when a new listing appears. Its marketing site is 38 URLs of Next.js App Router, derived from four TypeScript arrays rather than typed out, and I have audited most of it in public by now.

Here is one I had not looked at. Four of those routes end like this:

if ( ! site ) notFound (); // app/alerts/[site]/page.tsx if ( ! article ) notFound (); // app/guides/[slug]/page.tsx if ( ! target ) notFound (); // app/compare/[target]/page.tsx if ( ! article ) notFound (); // app/for/[audience]/page.tsx

Enter fullscreen mode

Exit fullscreen mode

Four deliberate throws into a page that does not exist in the repository:

$ find src -name "not-found*" -o -name "error*" -o -name "global-error*" -o -name "loading*" $

Enter fullscreen mode

Exit fullscreen mode

Nothing. No not-found.tsx , no error.tsx , no global-error.tsx , no loading.tsx anywhere under src .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.