wevm / wagmi

React Hooks for Ethereum
https://wagmi.sh
MIT License
5.79k stars 968 forks source link

Metamask connetor not working via CDN #4115

Closed artemkopytko closed 2 days ago

artemkopytko commented 3 days ago

Check existing issues

Describe the bug

Metamask connector fails if wagmi is being used via CDN. I've used the instruction from the documentation

Code: ` `

The error is listed below:

Screenshot 2024-07-05 at 15 55 45

Stackblitz demo is attached

Link to Minimal Reproducible Example

https://stackblitz.com/edit/vitejs-vite-8jmj3p?file=index.html&terminal=dev

Steps To Reproduce

Just press "Run" and take a look at the console

What Wagmi package(s) are you using?

@wagmi/connectors, @wagmi/core

Wagmi Package(s) Version(s)

@wagmi/core@2.11.0

Viem Version

2.17.1

TypeScript Version

No response

Anything else?

P.S. Injected and coinbaseWallet connectors works perfect. The problem is met with metamask only

jxom commented 2 days ago

Thanks for the issue! Might be best to raise this on the MetaMask SDK repository: https://github.com/MetaMask/metamask-sdk

artemkopytko commented 1 day ago

Thanks for the issue! Might be best to raise this on the MetaMask SDK repository: https://github.com/MetaMask/metamask-sdk

Hey! But I'm not importing metamask directly. It is being imported via https://esm.sh/@wagmi/connectors