Open
Description
Ethers Version
6.7.1
Search Terms
react native, ethers
Describe the Problem
I encountered the error 'JsonRpcProvider failed to detect the network and cannot start up; retry in 1s.' This may be due to an incorrect URL or the Ethereum node not being started when using JsonRpcProvider in my React Native app with version 0.71.5.
Code Snippet
getProvider(): ethers.JsonRpcProvider {
if (this.#provider) {
return this.#provider;
}
const config = ETH_NETWORK_CONFIG[this.#currentNetwork];
if (!config) {
return null;
}
this.#provider = new ethers.JsonRpcProvider(config.rpc);
this.#provider.send("eth_chainId", []).then(number => {
console.log(number)
})
return this.#provider;
}
Contract ABI
No response
Errors
LOG JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)
LOG JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)
LOG JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)
LOG JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)
LOG JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)
LOG JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)
LOG JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)
LOG JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)
LOG JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)
LOG JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)
LOG JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)
LOG JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)
LOG JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)
LOG JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)
LOG JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)
LOG JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)
LOG JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)
LOG JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)
Environment
No response
Environment (Other)
No response