-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@clerk/[email protected]
cause a build warning in NextJS middleware
#3660
Comments
Hi @arvinxx, thanks for raising the issue! We're working on a fix for it and it should be released soon. |
@arvinxx The fix has been merged and will soon release a patch for |
Hi @LauraBeatris I'm still facing what seems to be the same issue in my project
middleware.ts
Error
|
Hey @shawnesquivel! Thanks for reporting, I'm looking into this now and will keep you updated. |
Thanks @LauraBeatris . I tried making a minimal repro with no luck – it seems to work on a fresh repo when using the quickstart instructions. As an interim, here's what I've tried on my own project:
Let me know if there are specific actions I can take to help diagnose the issue better. |
@LauraBeatris I can confirm that this issue has presently went away when I stopped using it in a client component, denoted by the "use client" directive. The docs do say it should be able to be used in client components though, so I think it's still a bug worth noting. |
Hi @shawnesquivel! On client components, I agree that the error shown is confusing when using a server-side helper on a client-side component. On 5.1.0, the following was shown instead:
We should either continue displaying it or work on a better error message. |
I just encountered this issue. It seems that It connection with the Import { auth }, the documentation displays https://clerk.com/docs/references/nextjs/read-session-data Kindly inform the team responsible for the documentatio to add await, thus Well, the Clerk team must improve the documentation so that we won't get this kind of simple issues and waste both your time and ours. Thanks for your help.
|
Hey everyone! We're actively working to improve the error message when server-side helpers are used in a client-side context. I'll re-open this issue again and related to a PR soon. |
Hi @LauraBeatris @shawnesquivel , I'm facing the same issue. Is there a way to resolve this? |
I have the same issue, in |
My fix was to not use it in a client component – you should use |
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:javascript/packages/nextjs/src/server/clerkMiddleware.ts
Line 10 in 1a704ed
Environment
Next.JS: 14.2.4 @nextjs/clerk: >=5.2.0
The text was updated successfully, but these errors were encountered: