-
Notifications
You must be signed in to change notification settings - Fork 30.5k
Description
Link to the code that reproduces this issue
https://github.com/brysongilbert/nextjs-no-fallback-error-repro
To Reproduce
- Clone the reproduction repo
cd nextjs-no-fallback-error-repro && npm install && npm run build- Start the custom server:
npm run start:custom - Visit http://localhost:3000/about — returns 200, no errors in server console
- Visit http://localhost:3000/nonexistent — returns 404, but
Error: Internal: NoFallbackErroris logged toconsole.error - Stop the server, run npm start (next start) instead — repeat steps 4–5, same NoFallbackError logged to console
The custom server intercepts console.error to highlight the leak. The error appears in both server modes.
The next-16 branch reproduces the same behavior on Next.js 16.1.6:
git checkout next-16
npm install && npm run build
npm run start:custom
Current vs. Expected behavior
Current behavior: When dynamicParams = false is set and a request arrives for a param not in generateStaticParams, Next.js returns a correct 404 response but also logs Error: Internal: NoFallbackError to console.error. This is internal control-flow error handling leaking to the console.
Expected behavior: The 404 response should be returned with no error logged to console.error. NoFallbackError is an internal mechanism — it should be caught silently, not surfaced as an error.
Why this matters: APM tools (Datadog dd-trace, Sentry, New Relic) hook into console.error or intercept thrown errors during propagation. Every 404 from a dynamicParams = false route generates a false-positive error alert. At scale, bot traffic and crawlers hitting nonexistent paths produce hundreds of these per day, drowning out real errors.
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.6.0: Mon Jan 19 21:59:23 PST 2026; root:xnu-11417.140.69.708.3~1/RELEASE_ARM64_T6030
Available memory (MB): 36864
Available CPU cores: 12
Binaries:
Node: 22.21.1
npm: 10.9.4
Yarn: 1.22.22
pnpm: N/A
Relevant Packages:
next: 16.1.6
eslint-config-next: N/A
react: 19.2.4
react-dom: 19.2.4
typescript: 5.9.3
Next.js Config:
output: N/AWhich area(s) are affected? (Select all that apply)
Dynamic Routes, Error Handling, Not Found
Which stage(s) are affected? (Select all that apply)
next start (local), Other (Deployed)
Additional context
This affects any infrastructure that wraps Next.js or monitors console.error:
- Custom servers using getRequestHandler() — the standard Next.js custom server API
- Netlify (@netlify/plugin-nextjs) — wraps getRequestHandler() and surfaces these in function logs
- APM tools (Datadog dd-trace, Sentry) — intercept thrown errors during propagation, reporting NoFallbackError as a real error even when it's caught internally
The issue reproduces locally and on any platform. It is not browser-specific — it occurs server-side on every request to a dynamicParams = false route with an unknown param.
Tested on Next.js 15.5.12 and 16.1.6 — same behavior on both. Adding a custom not-found.tsx (root or segment level) has no effect.
The only current workaround is monkey-patching console.error to suppress NoFallbackError by string matching, which is fragile.