Replies: 3 comments
-
You need to have Web Crypto API to use Nano ID. We can change API if you tell us how to fix it. But I am not AWS user to give you my solution. |
Beta Was this translation helpful? Give feedback.
-
If I might chime in, Web Crypto API has only been available since Node 15, so do check if your lambda's Node version is 15 or later. |
Beta Was this translation helpful? Give feedback.
-
My env is Node 16, so this is not the problem. I am using own nodejs crypto module and it's working, if i remember correctly this error is due to the fact that getRandomValues doesn't work on server side. I used randomBytes with a custom logic for my case, but if anyone else find yourself with the same problem, maybe this comment can help. To solve this, however, I can't give you guys a proper solution since I am not an AWS expert myself |
Beta Was this translation helpful? Give feedback.
-
Greetings! I'm currently having an issue with nanoid at my serverless stack backend + lambda function.
This returns sometimes that "crypto.getRandomValues() is not a function". Other times, it will work, but it will generate only "1111111111"
Beta Was this translation helpful? Give feedback.
All reactions