Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No provider selected for request eth_chainId when coinbase wallet extension is installed #35

Open
vinceprofeta opened this issue Oct 26, 2021 · 3 comments

Comments

@vinceprofeta
Copy link

vinceprofeta commented Oct 26, 2021

Repro:
Install Coinbase Wallet

const prov: any = await detectEthereumProvider({ mustBeMetaMask: true });
const chainId: string = await prov.request({ method: 'eth_chainId' });
Error: No provider selected for request eth_chainId

From the docs:
This may happen, for example, if the user has multiple wallets installed. After confirming that your code and dependencies are not modifying or overwriting window.ethereum, you should ask the user to ensure that they only have a single provider-injecting wallet enabled at any one time.

Any solutions other than messaging?

@s1mplejac
Copy link

Any progress on this? I'm having a similar issue.

@s1mplejac
Copy link

This helped: https://ethereum.stackexchange.com/questions/111605/how-can-i-connect-my-dapp-to-metamask-if-coinbase-wallet-injects-another-ethere

@matricore
Copy link

useEffect(() => {
        if (isMetaMaskInstalled()) {
            if (window.ethereum.providers.length > 1) {
                const metamaskProvider = window.ethereum.providers.find((provider) => provider.isMetaMask);
                window.ethereum = metamaskProvider;
            }
        }
}, []);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants