Closed JeffWScott closed 3 years ago
Thanks for the report!
In that example, it doesn't look like you are requesting the user's accounts. You'll need to call eth_requestAccounts
to request permission to access a user's accounts first (documented here: https://docs.metamask.io/guide/rpc-api.html#permissions). This is exposed by web3.js as web3.eth.requestAccounts
I believe.
I'm surprised this had worked prior to 2 weeks ago :thinking: We've required that step for years now.
As you can see getAccounts exists on the Web3 object and did work before. It's possible it's a depreciated method that just recently got removed from metamask 9.
The good news is requestAccounts now triggers Metamask like before. I don't know how to thank you!
So the metamask-extension-provider was working really good for awhile up until probably a few weeks ago I would say. Then my users started reporting connection issues.
I read somewhere that maybe v9 of Metamask broke something so I updated all my package versions as you can see below.
I also validated Metamask is v9.0.3
I can get the provider and I can get the web3 instance. But what web3.eth.getAccounts() doesn't do anything anymore, it returns an empty array without ever prompting the user to connect their MetaMask.
Here is basically the code. Maybe something in the syntax has changed and someone can help me out please.
Any help would be appreciated as I have a few hundred users that are currently out in the cold here so I'm eager to get a fix.
Thanks!