Skip to content

notFound breaks Suspense in layout with cacheComponents enabled #86251

@ottetz

Description

@ottetz

Link to the code that reproduces this issue

https://github.com/ottetz/next-not-found-issue

To Reproduce

  1. pnpm build
  2. pnpm start
  3. open http://localhost:3000
  4. you see Application error: a client-side exception has occurred while loading localhost (see the browser console for more information).
    Console shows Uncaught Error: Connection closed.

Current vs. Expected behavior

Running app in dev mode corretly shows not found stub and Fetched Data from suspended component

Image

Expected built app to do the same

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10 Pro
  Available memory (MB): 32457
  Available CPU cores: 12
Binaries:
  Node: 20.18.2
  npm: 10.8.2
  Yarn: 1.22.22
  pnpm: 10.18.3
Relevant Packages:
  next: 16.0.3 // Latest available version is detected (16.0.3).
  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)

cacheComponents, Loading UI and Streaming, Not Found

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

next build (local), Vercel (Deployed)

Additional context

cacheComponents: true is required in next.config.js to reproduce

Metadata

Metadata

Assignees

Labels

Cache ComponentsRelated to the `cacheComponents`, `useCache`, or `ppr` experimental flags.Loading UI and StreamingRelated to loading UI (loading.tsx) and streaming.Not FoundRelated to the not-found.tsx file or the notFound() function.linear: nextConfirmed issue that is tracked by the Next.js team.locked

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions