Next.js Discord

Discord Forum

Route level not-found.tsx?

Unanswered
American black bear posted this in #help-forum
Open in Discord
American black bearOP
I have a website which has landing page and website at example.com and dashboard at example.com/dashboard. The dashboard has its own layout containing DashboardNav and dashboard specific contexts. But I have a problem when a user goes to a page on /dashboard that does not exist since it gives him the 404 page from my main website.

I have tried creating a route level not found page but it does not seem to be working.

/app
  /dashboard
    layout.tsx (contains navbar for dashboard route)
    not-found.tsx (not working)


Do you guys have any ideas for a workaround or solution to this problem.

0 Replies