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

bug: failure to switch chains using WalletConnect in Wagmi 2 #3347

Closed
1 task done
firnprotocol opened this issue Dec 25, 2023 · 7 comments
Closed
1 task done

bug: failure to switch chains using WalletConnect in Wagmi 2 #3347

firnprotocol opened this issue Dec 25, 2023 · 7 comments

Comments

@firnprotocol
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Package Version

rc (for wagmi 2)

Current Behavior

calling switchChain or switchChainAsync with WalletConnect throws:

SwitchChainError: An error occurred when attempting to switch chain.

Details: Cannot set properties of undefined (setting 'defaultChain')
Version: viem@2.0.0-rc.0
    at Object.switchChain (walletConnect.js:184:1)
    at async switchChain (switchChain.js:14:1)

Expected Behavior

should work.

Steps To Reproduce

connect using WalletConnect; then switch chain.

Link to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)

https://stackblitz.com/edit/vitejs-vite-ty17d7

Anything else?

No response

@cheshirrrcat
Copy link

I have the same issue with 1.4.12 version

@chybisov
Copy link
Contributor

I got this error from your example 👀

An error occurred when attempting to switch chain. Details: {"code":-32602,"message":"May not specify default MetaMask chain."} Version: viem@2.0.0-rc.2

image

I got Details: Cannot set properties of undefined (setting 'defaultChain') in my code but can't reproduce it now 😅

@chybisov
Copy link
Contributor

Something is really off with this chain switching using WalletConnect. I have another issue #3350 😄

@firnprotocol
Copy link
Author

yes, you're right! i also get a DIFFERENT error in the sandbox: "An error occurred when attempting to switch chain. Details: Missing or invalid. request() method: wallet_switchEthereumChain Version: viem@2.0.0-rc.2"

@glitch-txs
Copy link
Collaborator

@firnprotocol which wallet?

@glitch-txs
Copy link
Collaborator

hi, this is a WalletConnect issue, I've open an issue here feel free to close here/track there. Thanks!

@tmm tmm closed this as not planned Won't fix, can't repro, duplicate, stale Dec 27, 2023
Copy link
Contributor

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.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants