JohnFlick
JohnFlick9mo ago

Using crypto.randomUUID() in "node" environment.

I notice that the crypto.randonUUID() throw error when we declare the function with "use node". Are there any alternatives?
1 Reply
erquhart
erquhart9mo ago
Convex's node is v18, that method was added in v19 here's a couple of alternatives from good ol' SO: https://stackoverflow.com/a/73205206/1556245 (uuid.v4() and crypto.randomBytes())

Did you find this page helpful?