nextjs - 💡(How to fix) Fix `global-not-found` is not rendered for pages with dynamic paths [1 comments, 2 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#85444Fetched 2026-04-08 02:15:43
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×2closed ×1commented ×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 make any difference, neither does returning NextResponse.error().

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:

import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  experimental: {
    globalNotFound: true,
  },
};

export default nextConfig;
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 rendere a global-not-found.tsx in every instance 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 make any difference, 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:

import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  experimental: {
    globalNotFound: true,
  },
};

export default nextConfig;

Which area(s) are affected? (Select all that apply)

Dynamic Routes

Which stage(s) are affected? (Select all that apply)

next dev (local), Vercel (Deployed)

Additional context

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

extent analysis

TL;DR

The issue can be resolved by adjusting the Next.js configuration to correctly handle global not found pages.

Guidance

  • Verify that the global-not-found.tsx file is correctly configured and located in the root of the pages directory.
  • Check the Next.js documentation for any changes to the experimental.globalNotFound configuration option in version 16.0.0.
  • Try setting experimental.globalNotFound to false and then back to true to see if it makes a difference.
  • Test the application with a clean build and restart the development server to ensure that the changes take effect.

Example

No code example is provided as the issue seems to be related to configuration rather than code.

Notes

The issue is present in both version 15 and 16 of Next.js, and it affects both local development and production environments. This suggests that the issue might be related to the configuration or the way the global-not-found.tsx file is being handled.

Recommendation

Apply workaround: Adjust the Next.js configuration to correctly handle global not found pages, as the issue seems to be related to the configuration rather than a bug in the framework.

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` is not rendered for pages with dynamic paths [1 comments, 2 participants]