[X] I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)
[X] This issue is not a question, general help request, or anything other than a bug report directly related to Clerk. Please ask questions in our Discord community: https://clerk.com/discord.
Creating an optimized production build ...
✓ (pwa) Compiling for server...
✓ (pwa) Compiling for server...
✓ (pwa) Compiling for client (static)...
○ (pwa) Service worker: /vercel/path1/public/sw.js
○ (pwa) URL: /sw.js
○ (pwa) Scope: /
⚠ Compiled with warnings
./node_modules/@clerk/nextjs/dist/esm/server/clerkMiddleware.js
A Node.js module is loaded ('async_hooks' at line 3) which is not supported in the Edge Runtime.
Learn More: https://nextjs.org/docs/messages/node-module-in-edge-runtime
Import trace for requested module:
./node_modules/@clerk/nextjs/dist/esm/server/clerkMiddleware.js
./node_modules/@clerk/nextjs/dist/esm/server/index.js
./node_modules/@clerk/shared/dist/chunk-RSOCGYTF.mjs
A Node.js API is used (MessageEvent at line: 28) which is not supported in the Edge Runtime.
Learn more: https://nextjs.org/docs/api-reference/edge-runtime
Import trace for requested module:
./node_modules/@clerk/shared/dist/chunk-RSOCGYTF.mjs
./node_modules/@clerk/shared/dist/index.mjs
./node_modules/@clerk/nextjs/dist/esm/server/utils.js
./node_modules/@clerk/nextjs/dist/esm/server/clerkClient.js
./node_modules/@clerk/nextjs/dist/esm/server/index.js
you can see the error from @clerk/nextjs. please remove this usage:
Preliminary Checks
Reproduction
https://github.com/lobehub/lobe-chat/tree/reproduction/clerk-nextjs-5.2.0
Publishable key
no need, it's a build time issue
Description
here is the build log:
you can see the error from
@clerk/nextjs
. please remove this usage:https://github.com/clerk/javascript/blob/1a704ed9de3ad222ff17d10cb383639b2fc038b9/packages/nextjs/src/server/clerkMiddleware.ts#L10
Environment