Skip to content

Setting cacheComponents=true breaks Clerk sign-in route with “Uncached data outside <Suspense>” during build #85490

@techotaku1

Description

@techotaku1

Link to the code that reproduces this issue

https://github.com/techotaku1/gonzaapp

To Reproduce

  1. git clone https://github.com/techotaku1/gonzaapp
  2. cd gonzaapp
  3. npm install
  4. Set the Clerk test env vars (sample keys included in .env)
  5. npm run build -- --debug-prerender
  6. Observe the failure while prerendering /sign-in/[[...sign-in]]

Current vs. Expected behavior

Current:
Build fails with “Route "/sign-in/[[...sign-in]]": Uncached data was accessed outside of ” even though /sign-in is a client component wrapped in Suspense and contains no server-side data fetch.

Expected:
With cacheComponents enabled, the build should succeed (or at least fallback to “Cargando...”) without aborting.

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 10.0.22631
Binaries:
  Node: 22.21.0
  npm: 11.6.2
Relevant Packages:
  next: 16.0.0
  eslint-config-next: 16.0.0
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.5.4
Next.js Config:
  cacheComponents: true

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

Use Cache, Partial Prerendering (PPR), TypeScript

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

next dev (local), next build (local), Vercel (Deployed)

Additional context

Disabling cacheComponents makes the build succeed. I also tried wrapping the entire client layout in Suspense, moving the Clerk sign-in into a client-only component, and calling next/cache noStore(), but the build still fails. Reproduces on Next.js 16.0.0 and 16.0.1-canary. Deploying to Vercel shows the same build failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    TypeScriptRelated to types with Next.js.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions