Cache component feature breaks Clerk sign-in route with unclear Suspense boundary requirements.
The issue involves cacheComponents breaking Clerk sign-in routes during build with Suspense boundary errors, despite proper wrapping. The problem appears to be in the interaction between Next.js caching and Clerk's provider, with maintainers suggesting layout refactoring but no clear solution yet.
https://github.com/techotaku1/gonzaapp
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.
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
Use Cache, Partial Prerendering (PPR), TypeScript
next dev (local), next build (local), Vercel (Deployed)
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.
Claim this issue to let others know you're working on it. You'll earn 30 points when you complete it!