Error: Native crypto module could not be used to get secure random number.
See original GitHub issueDescribe the bug
I’m using the serverless.com framework together with: "amazon-cognito-identity-js": "^4.5.2"
and I still get the error: Error: Native crypto module could not be used to get secure random number.
even though it was supposed to be fixed in version 3.2.0
.
It happens when I use the CognitoUser.authenticateUser
method. Any updates on this issue?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:18
- Comments:64 (25 by maintainers)
Top Results From Across the Web
Native crypto module could not be used to get secure random ...
Seems like the error was thrown from below code lines (which were added on v3.2.0 ) in core.js . /* * Cryptographically secure...
Read more >Node.js: Native crypto module could not be used to get secure ...
3" for auth and stumbled over the error: Error: Native crypto module could not be used to get secure random number. when using...
Read more >Defender-relay-client - Error: Native crypto module could not ...
Environment $ node -v v10.15.0. $ npm -v 6.14.5. :memo: Details Error: Native crypto module could not be used to get secure random...
Read more >Crypto module breaking - Questions - n8n community
I'm trying to create a credential and getting the following error. ... "stack": "Error: Native crypto module could not be used to get...
Read more >Crypto.getRandomValues() - Web APIs | MDN
The pseudo-random number generator algorithm (PRNG) may vary ... getRandomValues() is not guaranteed to be running in a secure context.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am still experiencing this error with Angular 11 when running
ng-serve
, and @aws-amplify/auth.I have tried installing
"amazon-cognito-identity-js": "^4.5.4-unstable.6"
,and installing latest ampliy/core, auth and pubsub. Nothing works.
I can’t use require, TS compiler is freaking out.
Thanks again for the reproduction sample @Ladvace! I have made a small adjustment in this PR that should fix the behavior you’re seeing. It is available to use now with the
unstable
tag, and we will likely have a release tolatest
next week.Can you verify that
unstable
works for you?Also, with that fix, it is no longer required to add
global.crypto = require('crypto')
in your code, as this will handle that automatically.