react-native-sdk [Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.7.0)] #532
Tguntenaar
announced in
Help
Replies: 1 comment
-
To use ethersjs in react native I needed to import this shim. // Pull in the shims (BEFORE importing ethers)
import "@ethersproject/shims" |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey guys,
Im having trouble using ethersjs after I receive the private key from web3auth's sign in from the react native SDK. Im trying to get the balance of a wallet on a token contract. This code does work within a web environment, however it does not in React Native.
In respsonse I get noNetwork event.
[Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.7.0)]
While a simple fetch does work from the simulator.
Tried a few different things with no luck:
Tried changing ethers to v5.0.5 instead of v5.7.0
Tried JsonRpcProvider and StaticJsonRpcProvider instead of getDefaultProvider
Tried using 2 different rpc's
Tried using a different network
Using:
Expected output would be 0x373597efcc38aa38380000 in hexidecimals.
Beta Was this translation helpful? Give feedback.
All reactions