Skip to content

could not detect network #3035

Answered by ricmoo
QTTQ asked this question in Q&A
Discussion options

You must be logged in to vote

This means your network (or node, at least) does not support the eth_chainId RPC method. I believe on BSC this can be caused by CORS issues, or sometimes the backend is less reliable and doesn’t respond.

You can pass the network object in as the second parameter, and should probably use the StaticJsonRpcProvider instead of the normal JsonRpcProvider.

You can also check out this package: https://github.com/ethers-io/ancillary-bsc

Let me know if that helps. :)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by QTTQ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #3034 on May 30, 2022 03:58.