switchChain function received me an error: TypeError: Cannot destructure property 'addEthereumChainParameter' of 'parameters' as it is undefined. #4165
Replies: 2 comments 2 replies
-
You are missing the - await switchChain({ chainId: bsc.id });
+ await switchChain(config, { chainId: bsc.id }); |
Beta Was this translation helpful? Give feedback.
1 reply
-
@tmm it's not resolved, don't close this topic please |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an issue with switching my chain by click on button.
What i had do:
import { switchChain } from "@wagmi/core";
Then:
This handler i put into onClick={switchNetworkHandler} of my button.
But when i click on button i see this error:
TypeError: Cannot destructure property 'addEthereumChainParameter' of 'parameters' as it is undefined.
Where i made mistake, help me please.
By the way: other methods, like: window.ethereum.request working fine. But i want do it through wagmi...
Dependencies:
Beta Was this translation helpful? Give feedback.
All reactions