Skip to content

Conversation

@wobsoriano
Copy link
Member

@wobsoriano wobsoriano commented Dec 12, 2025

Description

This PR fixes a build error that occurs when using Next.js 16.1.0-canary.19 (which includes security fixes for CVE-2025-55183 and CVE-2025-55184).

Build error (without async):

▲ Next.js 16.1.0-canary.19 (Turbopack)
- Environments: .env

  Creating an optimized production build ...

> Build error occurred
Error: Turbopack build failed with 1 errors:
./node_modules/@clerk/nextjs/dist/esm/server/keyless-custom-headers.js:70:10
Ecmascript file had an error
  68 |   }
  69 | }
> 70 | function formatMetadataHeaders(metadata) {
     |          ^^^^^^^^^^^^^^^^^^^^^
  71 |   const headers2 = new Headers();
  72 |   if (metadata.nodeVersion) {
  73 |     headers2.set("Clerk-Node-Version", metadata.nodeVersion);

Server Actions must be async functions.

Import trace:
  Server Component:
    ./node_modules/@clerk/nextjs/dist/esm/server/keyless-custom-headers.js
    ./node_modules/@clerk/nextjs/dist/esm/app-router/server/keyless-provider.js
    ./node_modules/@clerk/nextjs/dist/esm/app-router/server/ClerkProvider.js
    ./node_modules/@clerk/nextjs/dist/esm/index.js
    ./app/layout.tsx


    at ./node_modules/ (clerk/nextjs/dist/esm/server/keyless-custom-headers.js:70:10)

Build success (with async):

▲ Next.js 16.1.0-canary.19 (Turbopack)
- Environments: .env

  Creating an optimized production build ...
✓ Compiled successfully in 2.1s
✓ Finished TypeScript in 1818.7ms
✓ Collecting page data using 9 workers in 441.3ms
✓ Generating static pages using 9 workers (8/8) in 93.0ms
✓ Finalizing page optimization in 11.6ms

formatMetadataHeaders is inside of a 'use server' file.

Discord ticket: https://discord.com/channels/856971667393609759/1449025014752874516

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@changeset-bot
Copy link

changeset-bot bot commented Dec 12, 2025

🦋 Changeset detected

Latest commit: 36ca0d5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clerk/nextjs Patch

Not sure what this means? Click here to learn what changesets are.

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

@vercel
Copy link

vercel bot commented Dec 12, 2025

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

Project Deployment Preview Comments Updated (UTC)
clerk-js-sandbox Ready Ready Preview Comment Dec 12, 2025 5:58pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 12, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch rob/fix-keyless-server-function

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 12, 2025

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@7445

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@7445

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@7445

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@7445

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@7445

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@7445

@clerk/elements

npm i https://pkg.pr.new/@clerk/elements@7445

@clerk/clerk-expo

npm i https://pkg.pr.new/@clerk/clerk-expo@7445

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@7445

@clerk/express

npm i https://pkg.pr.new/@clerk/express@7445

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@7445

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@7445

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@7445

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@7445

@clerk/clerk-react

npm i https://pkg.pr.new/@clerk/clerk-react@7445

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@7445

@clerk/remix

npm i https://pkg.pr.new/@clerk/remix@7445

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@7445

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@7445

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@7445

@clerk/themes

npm i https://pkg.pr.new/@clerk/themes@7445

@clerk/types

npm i https://pkg.pr.new/@clerk/types@7445

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@7445

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@7445

commit: 36ca0d5

@wobsoriano wobsoriano enabled auto-merge (squash) December 12, 2025 19:17
@wobsoriano wobsoriano merged commit f1885e0 into release/core-2 Dec 12, 2025
173 of 178 checks passed
@wobsoriano wobsoriano deleted the rob/fix-keyless-server-function branch December 12, 2025 19:21
wobsoriano added a commit that referenced this pull request Dec 12, 2025
…stom headers

Cherry-picked from PR #7431 and PR #7445:
- Fix ClerkRequest helper instance check using duck typing instead of instanceof
- Make formatMetadataHeaders async to comply with Server Actions
- Remove srvx dependency from tanstack-react-start integration template
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.

4 participants