user14587589
user14587589

Reputation: 459

React native crypto module issue

I created my app with expo init

and I'm trying to implement web3,I followed every instruction i've found on github but I'm still getting error

While trying to resolve module `crypto` from file `/home/user/Desktop/Wallet/Fanbase-Wallet-App/node_modules/bignumber.js/bignumber.js`, the package `/home/user/Desktop/Wallet/Fanbase-Wallet-App/node_modules/crypto/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/home/user/Desktop/Wallet/Fanbase-Wallet-App/node_modules/crypto/index.js`. Indeed, none of these files exist:

I have crypto in my package.json like this

"crypto": "react-native-crypto",

Any suggestion on how to fix this issue?

Upvotes: 1

Views: 2432

Answers (1)

Haseeb A
Haseeb A

Reputation: 6112

You have to use expo version of the crypto module.

expo install expo-crypto

more information is available here https://docs.expo.io/versions/latest/sdk/crypto/

For web3 there are other implementations in expo. Here is one for CRNA app. But comments include more details on to make it work on expo. https://gist.github.com/dougbacelar/29e60920d8fa1982535247563eb63766

Upvotes: 3

Related Questions