web3modal-react-native icon indicating copy to clipboard operation
web3modal-react-native copied to clipboard

[bug] Wallet connection disconnected after switching chain

Open jasonaviandres opened this issue 8 months ago • 5 comments

Link to minimal reproducible example

https://github.com/jasonaviandres/reown-appkit-simple-demo

Summary

I followed the documentation for have a simple implementation of connecting wallet and switching chain (https://docs.reown.com/appkit/react-native/core/installation#expo). I can connect successfully to Metamask Wallet. And then I tried to implement switch chain from my app. I tried both from <AppkitButton/> and useSwitchChain hook from wagmi, it went to Metamask and change the chain. but when it went back to my app, somehow:

  • result of connector from useAccount is undefined
  • result of status from useAccount is disconnected

I tried this on IOS.

https://github.com/user-attachments/assets/d7204cf1-4034-4e67-8795-1e8a5f59f460

List of related npm package versions

  • "viem": "^2.28.0"
  • "wagmi": "^2.15.0"
  • "@walletconnect/react-native-compat": "^2.20.0"
  • "@reown/appkit-wagmi-react-native": "^1.2.3"
  • "react-native-modal": "^13.0.1"
  • "expo": "~52.0.46"
  • "expo-application": "~6.0.2"
  • "@react-native-community/netinfo": "11.4.1"
  • "react-native-get-random-values": "~1.11.0"

Node.js Version

v22.11.00

Package Manager

[email protected]

jasonaviandres avatar Apr 25 '25 10:04 jasonaviandres

cc @ignaciosantise

rtomas avatar Apr 30 '25 21:04 rtomas

hey @jasonaviandres 👋 which version of Metamask are you using?

ignaciosantise avatar May 02 '25 13:05 ignaciosantise

@ignaciosantise hey, my Metamask version currently is v7.45.1

jasonaviandres avatar May 05 '25 04:05 jasonaviandres

hey @jasonaviandres we noticed Metamask was having some issues in their previous versions. Does the error happen with other wallets? Also, can you update to v7.45.2 ? I cannot reproduce the issue on my side

ignaciosantise avatar May 09 '25 13:05 ignaciosantise

hey @ignaciosantise I just updated my Metamask to version 7.45.2. it seems to work ok now, thank you so much

jasonaviandres avatar May 12 '25 07:05 jasonaviandres