Metamask Conflict

I’m trying to support both Coinbase Wallet and Metamask in my app. However, even in the Sandbox, I keep running into the same error- I can’t connect to Metamask. The steps to reproduce this error are:

  1. Open the Sandbox (web3react-demo)

  2. Click “Open in New Window”

  3. Click “Connect Wallet”

  4. Click “Coinbase Wallet” (connects Coinbase Wallet browser extension)

  5. Click “Disconnect”

  6. Click “Connect Wallet”

  7. Click “Metamask”

After Step 7, the wallet is still connected to my Coinbase Wallet. In other words, the account never changed from Coinbase Wallet → Metamask, even after refreshing the browser.

The only way I’ve been able to fix this error is to delete the Coinbase Wallet browser extension and rely on the Coinbase Wallet mobile app to approve transactions.

Do you know of another way to resolve this error?

@billy - take a look at our wallet docs and integrating Web3 react - Integrating with Web3-React - Let us know if that helps!

Thanks for responding @arood. Still not able to resolve this issue.

Even if I 1) manually log out of Coinbase Wallet and Metamask, and then 2) try to connect my Metamask wallet by clicking “Connect” (from the CodeSandbox example in the documentation), I get prompted to enter the Coinbase Wallet password and never get prompted to enter the Metamask wallet password.

If it helps, I get a similar error when I try to login with Metamask/Coinbase Wallet on the Uniswap V3 interface/Aave. So maybe it’s just an issue with my browser.

Hi @billy thank you for following up. This may be a dumb question but have you tried to disconnect your Coinbase Wallet from the dapp in the settings under “dapp connections”? In the meantime, I will dive in and see what else may be happening. Thanks!

Not a dumb question at all. I tried doing that but still no luck. Also been researching this on Stack overflow/Github. Seems like others have had a similar issue ([Bug]: Coinbase Wallet and Metamask Wallet conflicts · Issue #13622 · MetaMask/metamask-extension · GitHub). Really appreciate your help.

I was able to resolve this issue by clearing the localstorage after a user disconnects their wallet (not just removing the provider). Thanks for your help.

1 Like

I’m seeing the same behavior. When I log windows.ethereum.providers via

let providers = window.ethereum.providers;
console.log("Providers: ", providers);

I can see two providers, but both are listed as Coinbase. Is the Coinbase wallet extension somehow overwriting metamask? Logging out of the Coinbase wallet seems to restore Metamask.

Edit: I lied, logging out has no effect.