Is Clerk middleware setup usable with NextJS nodejs runtime? #2721
-
Preliminary Checks
Reproduction / Replay Linkasdf Publishable keyasdf DescriptionI'm getting the following error when trying to
Environmentasdf |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
Or maybe it's more that there are functions used which are not available in the Edge runtime? (I'm trying to use node, but middleware does not seem to be available in node...?)
|
Beta Was this translation helpful? Give feedback.
-
Please use GitHub discussions if you have a question. If you want to report a bug, please use the provided template and fill everything out. We can't help you if you fill in "asdf" everywhere - thanks! |
Beta Was this translation helpful? Give feedback.
-
We are experiencing this also, but as far as I can tell, we are importing
|
Beta Was this translation helpful? Give feedback.
-
I can confirm that changing my imports for However, after seeing this, I've tried only updating the import for |
Beta Was this translation helpful? Give feedback.
I can confirm that changing my imports for
authMiddleware
,auth
, andcurrentUser
from@clerk/nextjs
to@clerk/nextjs/server
has resolved the issue. Note that any of the components, likeUserButton
, still had to import from@clerk/nextjs
.However, after seeing this, I've tried only updating the import for
authMiddleware
. This works too! I compared the output sizes, and keeping@clerk/nextjs/server
whenever possible does indeed reduce size a bit, but only when@clerk/nextjs
is not imported at all in that file.