wevm / wagmi

Reactive primitives for Ethereum apps
https://wagmi.sh
MIT License
5.99k stars 1.07k forks source link

Metamask showing when not on connectors #3393

Closed c0rdeiro closed 10 months ago

c0rdeiro commented 10 months ago

Describe the bug

Metamask always shows even when it is not defined on connectors (example here https://stackblitz.com/edit/new-wagmi-aon6zk) This happens when the browser has the extension, I tried with an incognito with no extensions and it works has it should So my guess is that injected is always being loaded, even if the injected() is not on the connectors

Link to Minimal Reproducible Example

https://stackblitz.com/edit/new-wagmi-aon6zk

Steps To Reproduce

No response

Wagmi Version

2.0.3

Viem Version

2.0.2

TypeScript Version

5.2.2

Check existing issues

Anything else?

No response

glitch-txs commented 10 months ago

This is EIP-6963 which will detect the wallets that you have installed and create a connector for each of them. This is better than the injected connector because it avoids conflicts when you have multiple wallets installed.

However if you'd like to disable it you can do it with this flag: https://wagmi.sh/react/api/createConfig#multiinjectedproviderdiscovery

c0rdeiro commented 10 months ago

But that way we might have duplicate connectors, for example if I define metamask in connectors and user has the metamask extension. How can this be avoided? only by disabling with that flag?

tmm commented 10 months ago

Could try something like this https://github.com/wevm/wagmi/discussions/3068#discussioncomment-8032468

Closing this issue for now as it's not an issue.

github-actions[bot] commented 9 months ago

This issue has been locked since it has been closed for more than 14 days.

If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest wagmi version. If you have any other comments you can create a new discussion.