Skip to content

Conversation

@jacekradko
Copy link
Member

Summary

Adds integration test app for Next.js 16 cache components feature to validate Clerk's auth() behavior with the new cacheComponents config.

Test Scenarios

  • auth() in server components, server actions, and API routes
  • "use cache" correct pattern (auth outside, userId passed in)
  • "use cache" error documentation
  • PPR with auth()
  • Protected routes via proxy

Key Findings

  • ClerkProvider must be wrapped in <Suspense> for cache components to work
  • auth() inside "use cache" functions produces build-time error
  • Route segment configs (dynamic) incompatible with cacheComponents
  • Next.js 16 moved experimental.ppr to top-level cacheComponents

Files Added

  • integration/templates/next-cache-components/ - Full test app
  • integration/tests/cache-components.test.ts - E2E tests
  • Updated integration/presets/next.ts with cacheComponents preset

Test plan

  • Run e2e tests: pnpm test:integration:next-cache-components
  • Verify build passes: cd integration/templates/next-cache-components && pnpm build

Add integration test app for Next.js 16 cache components feature to validate
Clerk's auth() behavior with the new cacheComponents config.

Test scenarios:
- auth() in server components, server actions, and API routes
- 'use cache' correct pattern (auth outside, userId passed in)
- 'use cache' error documentation
- PPR with auth()
- Protected routes via proxy

Key findings:
- ClerkProvider must be wrapped in Suspense for cache components
- auth() inside 'use cache' functions produces build-time error
- Route segment configs (dynamic) incompatible with cacheComponents
@vercel
Copy link

vercel bot commented Feb 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Feb 2, 2026 4:10am

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Feb 2, 2026

⚠️ No Changeset found

Latest commit: 3a70981

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants