Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/9smrdm
To Reproduce
- Run the application in production i.e.
next start (error only occurs in production environments)
- Navigate to an unmatched route that invokes
notFound() in the base layout.tsx (e.g. /random.xml)
- The application throws the above mentioned server error instead of serving the custom 404 page
Current vs. Expected behavior
The application works as intended with the same code and exact same steps when rerun in Next.js 16.2.3 suggesting a regression between that version and Next.js 16.2.6. Like I mentioned before, the issue only comes up in production environments with cacheComponents enabled and does not reproduce in dev builds.
Request Logs:
[Error: An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.] {
digest: 'NEXT_HTTP_ERROR_FALLBACK;404'
}
[Error: An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.] {
digest: 'NEXT_HTTP_ERROR_FALLBACK;404'
}
[Error: An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.] {
digest: 'NEXT_HTTP_ERROR_FALLBACK;404'
}
[Error: An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.] {
digest: 'NEXT_HTTP_ERROR_FALLBACK;404'
}
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Enterprise
Available memory (MB): 4009
Available CPU cores: 4
Binaries:
Node: 22.16.0
npm: 11.12.1
Yarn: N/A
pnpm: 9.15.4
Relevant Packages:
next: 16.2.6
eslint-config-next: N/A
react: 19.2.4
react-dom: 19.2.4
typescript: 5.9.3
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Error Handling
Which stage(s) are affected? (Select all that apply)
next start (local)
Additional context
No response
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/9smrdm
To Reproduce
next start(error only occurs in production environments)notFound()in the baselayout.tsx(e.g. /random.xml)Current vs. Expected behavior
The application works as intended with the same code and exact same steps when rerun in Next.js 16.2.3 suggesting a regression between that version and Next.js 16.2.6. Like I mentioned before, the issue only comes up in production environments with
cacheComponentsenabled and does not reproduce in dev builds.Request Logs:
Provide environment information
Which area(s) are affected? (Select all that apply)
Error Handling
Which stage(s) are affected? (Select all that apply)
next start (local)
Additional context
No response