Lesson 8: Uncaught (in promise) TypeError: ethers.providers.getWeb3Provider is not a constructor #2275
-
In Lesson 8, when we are setting up Web3Provider:
I am getting this error
It is working fine with JsonRpcProvider:
But using JsonRpcProvider with localhost RPC url does not updates my balances in metamask. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@daswanihimanshu010 replace |
Beta Was this translation helpful? Give feedback.
@daswanihimanshu010 replace
getWeb3Provider(windom.ethereum)
withWeb3Provider(window.ethereum)
It should be
const provider = new ethers.providers.Web3Provider(window.ethereum)