vercel / vercel/next.js

NoFallbackError logged to console.error when dynamicParams = false rejects a param

Open
#90,537 1 comment 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dynamic Routes Error Handling linear: next Not Found
Dominant language
JavaScript
Stars
142k
Forks
32.4k
Avg merge
2d 14h
Merged PRs (30d)
351

Description

Link to the code that reproduces this issue

https://github.com/brysongilbert/nextjs-no-fallback-error-repro

To Reproduce
  1. Clone the reproduction repo
  2. cd nextjs-no-fallback-error-repro && npm install && npm run build
  3. Start the custom server: npm run start:custom
  4. Visit http://localhost:3000/about — returns 200, no errors in server console
  5. Visit http://localhost:3000/nonexistent — returns 404, but Error: Internal: NoFallbackError is logged to console.error
  6. 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/A
Which 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked reproduction and its custom server using getRequestHandler(), then trace the dynamicParams=false and generateStaticParams path for an unknown parameter in both start modes. Done means the request still returns 404 without logging NoFallbackError to console.error, including when a custom not-found.tsx is present.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, next.js, react
Domain
backend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.