-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Open
Labels
Not FoundRelated to the not-found.tsx file or the notFound() function.Related to the not-found.tsx file or the notFound() function.
Description
Link to the code that reproduces this issue
https://github.com/jorrit/nextjs-test-not-found
To Reproduce
- Clone https://github.com/jorrit/nextjs-test-not-found
npm ci,npm run dev- Visit
http://localhost:3000 - Notice that
NotFound is renderedis written to the server console
Current vs. Expected behavior
Currently, the not-found.tsx file is rendered for every page view. I want to use this file to run a query to see if a redirect exists for the current URL. This is not possible when this component is rendered on every pageview.
Also, it seems like a waste of effort.
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 11 Pro
Available memory (MB): 32469
Available CPU cores: 20
Binaries:
Node: 22.18.0
npm: 11.1.0
Yarn: 1.22.22
pnpm: 9.15.4
Relevant Packages:
next: 16.0.10 // Latest available version is detected (16.0.10).
eslint-config-next: N/A
react: 19.2.1
react-dom: 19.2.1
typescript: 5.9.3
Next.js Config:
output: N/AWhich area(s) are affected? (Select all that apply)
Not Found
Which stage(s) are affected? (Select all that apply)
next start (local)
Additional context
No response
Metadata
Metadata
Assignees
Labels
Not FoundRelated to the not-found.tsx file or the notFound() function.Related to the not-found.tsx file or the notFound() function.