Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled Promise when connect to wallet connect. #3

Open
jeff0723 opened this issue Jul 14, 2022 · 2 comments
Open

Unhandled Promise when connect to wallet connect. #3

jeff0723 opened this issue Jul 14, 2022 · 2 comments

Comments

@jeff0723
Copy link

Hi, I am trying to integrate this project into my react native app. However, I kept encountering this error.

[Unhandled promise rejection: Error: Secure random number generation is not supported by this browser.]

I've checked the package version, just want to ask how can I possibly fix it.

@BenjaminSnoha
Copy link

BenjaminSnoha commented Jul 23, 2022

@jeff0723 I had the same issue. The fix was to make sure I had the following packages:

expo-crypto-polyfills
react-native-get-random-values

NOT the following (creates conflicting definitions):

react-native-crypto
react-native-randombytes
tradle/rn-nodeify

Make sure the following files are in your root directory:

global.js / .ts
metro.config.js / .ts

Lastly importantly include:

import './global';

At the top of your entry App.js (or ts) file. This is the step I forgot and went down a rabbit hole. Hopefully this helps.

@inhumantsar
Copy link

thanks @BenjaminSnoha! i was missing the import too. banged my head against the wall a bit longer tho because vscode kept sorting it to the bottom of my imports. disabling that and moving it to the very top fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants