notFound and not-found.js
Answer: Call notFound() to render the nearest not-found.js UI for missing resources. Use global-not-found.js for unmatched routes.
See also
Claims
- id: C1 claim: notFound renders the not-found UI. source: S2 evidence: "
notFoundfunction throws an error that renders the not-found UI."
- id: C2 claim: notFound helps handle missing resources. source: S2 evidence: "renders the not-found UI. It's useful for handling missing resources"
- id: C3 claim: not-found.js runs when notFound is called. source: S1 evidence: "when you call the
notFoundfunction in a route segment."
- id: C4 claim: global-not-found covers unmatched routes. source: S1 evidence: "Used to define a global 404 page for unmatched routes"
Sources
- [S1] not-found.js. Next.js docs. https://nextjs.org/docs/app/api-reference/file-conventions/not-found . License: MIT (vercel/next.js). Accessed 2026-11-09.
- [S2] notFound. Next.js docs. https://nextjs.org/docs/app/api-reference/functions/not-found . License: MIT (vercel/next.js). Accessed 2026-11-09.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Copyright (c) 2025 Vercel, Inc. Sources: Next.js docs (vercel/next.js on GitHub / nextjs.org), MIT (https://raw.githubusercontent.com/vercel/next.js/canary/license.md). Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Next.js docs, not-found.js, MIT (vercel/next.js); Next.js docs, notFound, MIT (vercel/next.js). Copyright (c) 2025 Vercel, Inc. MIT (https://raw.githubusercontent.com/vercel/next.js/canary/license.md).
Cite this
iinventedlight. 2026. "notFound and not-found.js." iinventedlight Library, iil:note:246yragd, version of 2026-11-09. https://iinventedlight.com/library/notes/nextjs-not-found/. License: CC-BY-4.0.
@misc{iil_note_246yragd,
author = {{iinventedlight}},
title = {{notFound and not-found.js}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-09},
url = {https://iinventedlight.com/library/notes/nextjs-not-found/},
note = {Permanent ID iil:note:246yragd. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/nextjs-not-found.md.