Replies: 1 comment
-
|
我也遇到了这样的问题 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
🧩 Context
I'm building a deposit flow using:
[email protected]
[email protected]
@web3modal/[email protected]
My users can switch between chains (e.g., BSC → Polygon) via a dropdown before deposit.
I use switchChainAsync({ chainId }) in the onSubmit of a form.
📱 Issue on MetaMask Mobile (via WalletConnect)
When calling switchChainAsync({ chainId }) on mobile with WalletConnect + MetaMask, I get an error:
This happens before the user even taps “Open MetaMask” in the WalletConnect modal (i.e., before the DApp has control again).
This behavior does not happen on desktop browsers.
And i saw the same issue on #4600 but it's closed with no solution.
✅ What I tried
Verified chain ID is valid and matches the dropdown selection.
Checked getAccount(wagmiConfig).connector.id === 'walletConnect'
Waited for getWalletClient() before calling switchChainAsync (no effect).
Tried delay/wait but issue persists.
Confirmed that MetaMask is already unlocked and on BSC.
🧠 Expected
I expect switchChainAsync to trigger the WalletConnect request → then user switches network in MetaMask → then returns control.
Currently, it fails before that can happen.
ℹ️ Questions
Beta Was this translation helpful? Give feedback.
All reactions