nextjs - 💡(How to fix) Fix global-not-found not served for pages with dynamic paths [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#85446Fetched 2026-04-08 02:15:41
View on GitHub
Comments
0
Participants
1
Timeline
7
Reactions
5
Participants
Timeline (top)
labeled ×3subscribed ×2cross-referenced ×1issue_type_added ×1

Error Message

Instead, Next.js ignores the global-not-found.tsx and renders a framework default Not Found page. Calling notFound() does not have any effect on this, neither does returning NextResponse.error(). Dynamic Routes, Error Handling, Not Found

Root Cause

  1. Start the app in dev mode
  2. Navigate to http://localhost:3000/404 or any url that doesn't exist — see global-not-found.tsx being rendered
  3. Navigate to http://localhost:3000/blog — see as per above (because the page doesn't exist)
  4. Navigate to http://localhost:3000/blog/article — page exists and renders
  5. Navigate to http://localhost:3000/blog/any-other-slug — a default 404 is being rendered

Code Example

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Aug 11 21:11:04 PDT 2025; root:xnu-11417.140.69.701.11~1/RELEASE_ARM64_T6031
  Available memory (MB): 36864
  Available CPU cores: 14
Binaries:
  Node: 22.20.0
  npm: 10.9.3
  Yarn: 1.22.22
  pnpm: 10.18.2
Relevant Packages:
  next: 16.0.0 // Latest available version is detected (16.0.0).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: N/A
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/matthewmorek/global-not-found-repro.git

To Reproduce

  1. Start the app in dev mode
  2. Navigate to http://localhost:3000/404 or any url that doesn't exist — see global-not-found.tsx being rendered
  3. Navigate to http://localhost:3000/blog — see as per above (because the page doesn't exist)
  4. Navigate to http://localhost:3000/blog/article — page exists and renders
  5. Navigate to http://localhost:3000/blog/any-other-slug — a default 404 is being rendered

Current vs. Expected behavior

Next.js should render a global-not-found.tsx in every instance when this is enabled in configuration and provided in the codebase, since there isn't another not-found.tsx present in any other colocated routes.

Instead, Next.js ignores the global-not-found.tsx and renders a framework default Not Found page. Calling notFound() does not have any effect on this, neither does returning NextResponse.error().

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Aug 11 21:11:04 PDT 2025; root:xnu-11417.140.69.701.11~1/RELEASE_ARM64_T6031
  Available memory (MB): 36864
  Available CPU cores: 14
Binaries:
  Node: 22.20.0
  npm: 10.9.3
  Yarn: 1.22.22
  pnpm: 10.18.2
Relevant Packages:
  next: 16.0.0 // Latest available version is detected (16.0.0).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  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 dev (local), Vercel (Deployed)

Additional context

This has been present in both latest v15 and v16, regardless of configuration, and is affecting local dev as well as production

extent analysis

TL;DR

The issue may be resolved by verifying the configuration and implementation of the global not found page in Next.js, specifically ensuring that the global-not-found.tsx file is correctly set up and referenced.

Guidance

  • Review the Next.js documentation to ensure that the global not found page is correctly configured and implemented.
  • Verify that the global-not-found.tsx file is in the correct location and is being exported correctly.
  • Check the Next.js version and configuration to ensure that it supports global not found pages.
  • Test the implementation by creating a custom not found page and verifying that it is rendered correctly.

Example

No code snippet is provided as the issue lacks specific implementation details.

Notes

The issue may be related to a configuration or implementation issue in Next.js, and resolving it may require verifying the setup and implementation of the global not found page.

Recommendation

Apply workaround: Verify the configuration and implementation of the global not found page in Next.js, and test the implementation to ensure that it is working correctly. This is because the issue is likely related to a configuration or implementation issue, and resolving it may require verifying the setup and implementation of the global not found page.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

nextjs - 💡(How to fix) Fix global-not-found not served for pages with dynamic paths [1 participants]