Alex Styl
01/30/2025, 5:28 AMcrypto is not defined at secureRandomUuid
when i try to use Uuid.random()
in nodejs.
Weird thing is it works fine locally (mac) but it fails on my server (ubuntu).
I was using Uuid.random normally the past few days and I just got this issue now. I don't need to install crypto to use right?ephemient
01/30/2025, 5:32 AMcrypto
is only available in the default top-level namespace since v19, https://nodejs.org/en/blog/announcements/v19-release-announce#stable-webcryptoAlex Styl
01/30/2025, 5:33 AMAlex Styl
01/30/2025, 5:34 AMAlex Styl
01/30/2025, 5:35 AMephemient
01/30/2025, 5:40 AM--experimental-global-webcrypto
jw
01/30/2025, 5:41 AMglobalThis.crypto = require('node:crypto').webcrypto
I thinkAlex Styl
01/30/2025, 6:08 AMUuid.random()
on my server (changed my app's logic so now some objects are created fresh on the server instead of being prebuilt)
Ended up updating node using nvm (simplest method i think) and it works the same on both machinesEdoardo Luppi
01/30/2025, 8:15 AMcrypto
lolephemient
01/30/2025, 8:19 AMEdoardo Luppi
01/30/2025, 8:20 AMCarter
01/30/2025, 10:27 AMephemient
01/30/2025, 10:50 AM