Error pages

Errors handling

When an error occurs on a page, the error is intercepted by an error route.

The page is defined by src/app/error.tsx and it renders the component <PageError />

You can define specific error pages by adding an error.tsx file to a nested route, for instance inside the folder src/app/dashboard/

Not Found

If a page route doesn't exist, the Not Found page is rendered.

Customize it by editing the file src/app/not-found.tsx

Learn more about Next.js Error Handling

Last updated