EXT
nextjs
routing_error
ai_generated
true
Error: NEXT_NOT_FOUND
ID: nextjs/not-found-function
90%Fix Rate
90%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 14 | active | — | — | — |
Root Cause
notFound() called in wrong context or not-found.tsx page missing.
genericWorkarounds
-
95% success Create a not-found.tsx file in the appropriate route segment
// app/not-found.tsx export default function NotFound() { return <div>Not Found</div> }Sources: https://nextjs.org/docs/app/api-reference/file-conventions/not-found
-
88% success Ensure notFound() is called in a Server Component, not a Client Component
import { notFound } from 'next/navigation'; // call in Server Component onlySources: https://nextjs.org/docs/app/api-reference/functions/not-found
Dead Ends
Common approaches that don't work:
-
Use redirect('/404') instead
75% fail
Creates a redirect loop or shows wrong status code
-
Throw a custom 404 error
70% fail
Next.js has built-in notFound() — custom errors bypass its handling
Error Chain
Frequently confused with: