Title: Turbopack build error: formatMetadataHeaders causes Turbopack build failure in Next.js 16 canary · Issue #7461 · clerk/javascript · GitHub
Open Graph Title: Turbopack build error: formatMetadataHeaders causes Turbopack build failure in Next.js 16 canary · Issue #7461 · clerk/javascript
X Title: Turbopack build error: formatMetadataHeaders causes Turbopack build failure in Next.js 16 canary · Issue #7461 · clerk/javascript
Description: Hi! 👋 Firstly, thanks for your work on this project! 🙂 Today I used patch-package to patch @clerk/nextjs@6.36.2 for the project I'm working on. When building with Next.js 16.1.0-canary.21 and Turbopack enabled, the build fails because fo...
Open Graph Description: Hi! 👋 Firstly, thanks for your work on this project! 🙂 Today I used patch-package to patch @clerk/nextjs@6.36.2 for the project I'm working on. When building with Next.js 16.1.0-canary.21 and Turbo...
X Description: Hi! 👋 Firstly, thanks for your work on this project! 🙂 Today I used patch-package to patch @clerk/nextjs@6.36.2 for the project I'm working on. When building with Next.js 16.1.0-canary.21 and T...
Opengraph URL: https://github.com/clerk/javascript/issues/7461
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Turbopack build error: formatMetadataHeaders causes Turbopack build failure in Next.js 16 canary","articleBody":"Hi! 👋 \n \nFirstly, thanks for your work on this project! 🙂\n\nToday I used [patch-package](https://github.com/ds300/patch-package) to patch `@clerk/nextjs@6.36.2` for the project I'm working on.\n\nWhen building with Next.js 16.1.0-canary.21 and Turbopack enabled, the build fails because `formatMetadataHeaders` in `keyless-custom-headers.js` is not recognized as an async function. Making it async resolves the issue.\n\nHere is the diff that solved my problem:\n\n```diff\ndiff --git a/node_modules/@clerk/nextjs/dist/esm/server/keyless-custom-headers.js b/node_modules/@clerk/nextjs/dist/esm/server/keyless-custom-headers.js\nindex 11ccc7a..8994dad 100644\n--- a/node_modules/@clerk/nextjs/dist/esm/server/keyless-custom-headers.js\n+++ b/node_modules/@clerk/nextjs/dist/esm/server/keyless-custom-headers.js\n@@ -67,7 +67,7 @@ function getNextVersion() {\n return void 0;\n }\n }\n-function formatMetadataHeaders(metadata) {\n+async function formatMetadataHeaders(metadata) {\n const headers2 = new Headers();\n if (metadata.nodeVersion) {\n headers2.set(\"Clerk-Node-Version\", metadata.nodeVersion);\n```\n\n\u003cem>This issue body was [partially generated by patch-package](https://github.com/ds300/patch-package/issues/296).\u003c/em>\n","author":{"url":"https://github.com/namodynamic","@type":"Person","name":"namodynamic"},"datePublished":"2025-12-15T11:36:57Z","url":"https://github.com/clerk/javascript/issues/7461"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9292f246-baab-50a4-a0d0-c92a0b3c77d9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB84:11DC7C:12AA03B:19760E3:6AFB6C88 |
| html-safe-nonce | 4934bc960f933cf3fc8dcb30cbcb8b05e76f59fc35cc3f6943347b5ddf73f14a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjg0OjExREM3QzoxMkFBMDNCOjE5NzYwRTM6NkFGQjZDODgiLCJ2aXNpdG9yX2lkIjoiNTU4ODc1NTgwOTc5MDgxNTM2OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | bc9d170df61e1039a9e96b5be5f28e48351537c2dd9f6bcfa9c13e78d60a5a02 |
| hovercard-subject-tag | issue:3730023806 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/clerk/javascript/7461/issue_layout |
| twitter:image | https://opengraph.githubassets.com/04266211cdbfe45e7a46b00bbaa98ff7d27c062b3f9592935f43ce3ae1027b6a/clerk/javascript/issues/7461 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/04266211cdbfe45e7a46b00bbaa98ff7d27c062b3f9592935f43ce3ae1027b6a/clerk/javascript/issues/7461 |
| og:image:alt | Hi! 👋 Firstly, thanks for your work on this project! 🙂 Today I used patch-package to patch @clerk/nextjs@6.36.2 for the project I'm working on. When building with Next.js 16.1.0-canary.21 and Turbo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | namodynamic |
| hostname | github.com |
| expected-hostname | github.com |
| None | cca289ecd54650fcf3c0b037a58b97186dee2cc4406819d87fab93728fd83700 |
| turbo-cache-control | no-preview |
| go-import | github.com/clerk/javascript git https://github.com/clerk/javascript.git |
| octolytics-dimension-user_id | 49538330 |
| octolytics-dimension-user_login | clerk |
| octolytics-dimension-repository_id | 438331492 |
| octolytics-dimension-repository_nwo | clerk/javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 438331492 |
| octolytics-dimension-repository_network_root_nwo | clerk/javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 88808b1fae5ab8a526a73e7ce5542a10eb9d6971 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width