Replies: 14 comments
-
Hmmm. That seems like your plug-in is not getting registered before the shims are loaded. Check out #1070 |
Beta Was this translation helpful? Give feedback.
-
Oh. That issue was yours too. :) Can you try not including the shim, and see if crypto.randomValues exists? |
Beta Was this translation helpful? Give feedback.
-
The previous issue is getting too long to read and this issue is more specific about the random module. After comment out
|
Beta Was this translation helpful? Give feedback.
-
The solution found is that the module
The warning disappears after importing random module before shim as above. |
Beta Was this translation helpful? Give feedback.
-
Awesome!! Thanks! :) |
Beta Was this translation helpful? Give feedback.
-
suddenly I have the same issue in ios emulator but there wasn't any before
I already have above import order but no chance at all. Following is the error thrown. Any suggestion?
|
Beta Was this translation helpful? Give feedback.
-
I have the problem resurfaced with React Native 0.68.0, React Native get random values 1.7.2 and ethers 5.6.0. I am not sure when the code stopped working and just found out today. Then I upgrade the RN get random values to latest 1.8.0 and ethers to 5.6.5. But the error is the same. Here is the line of code throwing error:
Here is the error:
|
Beta Was this translation helpful? Give feedback.
-
I have also imported import 'react-native-get-random-values' these two in App.tsx (entry file) have solved the problem for me. |
Beta Was this translation helpful? Give feedback.
-
Thanks man, You just saved my day |
Beta Was this translation helpful? Give feedback.
-
Importing both rn get random values and shims in either App.js and index.js didn't work for me. |
Beta Was this translation helpful? Give feedback.
-
ethersjs recognize the polyfill of crypto.getRandomBytes but seems viewing it as insecure source of PRNG.
|
Beta Was this translation helpful? Give feedback.
-
FYI. The cookbook entry may help. |
Beta Was this translation helpful? Give feedback.
-
i'm also facing the same issue |
Beta Was this translation helpful? Give feedback.
-
global.crypto.getRandomValues() does exist as I verified. In my app, If new ethers.utils.randomBytes(32) throws error, then in catch block global.crypto.getRandomValues() will be used to generate a crypto secure random string. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
My React Native 63.2 app get the following warning about missing a secure random source, after installing
react-native-get-random-values
Here is the related
package.json
:Here is the import header:
Does the warning smell trouble? Or just a warning and can be ignored after installing
react-native-get-random-values
.Beta Was this translation helpful? Give feedback.
All reactions