not-found.js

The special file not-found.js nearest above in the route hierarchy is served in place of page.js or route.js if the URL is inaccessible.

Unlike error.js, this file exports a server component.

Below, we try to open "https://[domain]/dashboard" which is inaccessible as "app/dashboard/page.tsx" has not been created. Notice how 'not-found.tsx' uses the layout in the same segment.