[ERROR] Could not resolve "node:async_hooks"
Hello,
I have this error when trying to run
npx convex dev
Any idea?
2 Replies
This errors happens after invoking currentUser from clerk server.
import { currentUser } from '@clerk/nextjs/server'
And using it inside a convex query function.
const user = await currentUser()
It looks like a Convex function is trying to import @clerk/nextjs code, which doesn't work. You'll need to track down which files this is and not import code that can't run in the Convex environment in convex files.