wagmi icon indicating copy to clipboard operation
wagmi copied to clipboard

[Bug] switchChain is not working

Open davidli108 opened this issue 6 months ago • 0 comments

Check existing issues

Describe the bug

  1. To reproduce
  • connect wallet to Ethereum main network (Any other network is possible but not Sepolia). You will see the popup to switch to Sepolia but DON'T switch.
  • Refresh the page
  • As soon as page is refreshed, you should see popup to switch to Sepolia. But it doesn't happen.
  1. List of related npm package versions
  • wagmi: 2.12.7
  • viem: 2.20.0
  • @tanstack/react-query 5.52.0

Link to Minimal Reproducible Example

No response

Steps To Reproduce

Here is the link: https://codesandbox.io/p/sandbox/test-switchchain-hdn6hr

  • connect wallet to Ethereum main network (Any other network is possible but not Sepolia). You will see the popup to switch to Sepolia but DON'T switch.
  • Refresh the page
  • As soon as page is refreshed, you should see popup to switch to Sepolia. But it doesn't happen.

What Wagmi package(s) are you using?

wagmi

Wagmi Package(s) Version(s)

2.12.7

Viem Version

2.20.0

TypeScript Version

No response

Anything else?

No response

davidli108 avatar Aug 23 '24 14:08 davidli108