-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Switch network doesn't work with non default chains #180
Comments
This comment was marked as outdated.
This comment was marked as outdated.
Looks like there's an issue with MetaMask, where it emits a Until this gets fixed, I'm adding a shim to help prevent this from happening. #190 |
OK thanksThough, the bug doesn't happen with default chains in wagmi-------- Original message --------From: awkweb ***@***.***>Date: Sun, 20 Feb 2022, 01:00To: tmm/wagmi ***@***.***>Cc: layinka ***@***.***>, Author ***@***.***>Subject: Re: [tmm/wagmi] Switch network doesn't work with non default chains (Issue #180)
Looks like there's an issue with MetaMask, where is emits a disconnect event before switching chain.
MetaMask/metamask-extension#13375 (comment)
Until this gets fixed, I'm adding a shim to help prevent this from happening. #190
—Reply to this email directly, view it on GitHub, or unsubscribe.Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Yup, that's correct. It looks like it only occurs when you use chains not built-in to MetaMask. |
Looks like this was an issue on MM's side and works again when testing (using this CodeSandbox). @layinka can you try out and re-open this issue if it doesn't work? |
@tmm I still have this issue when switching between BSC and BSC Testnet. Not sure how related this is to "non-default chains". This Error bubbles up, not sure where it is coming from though.
|
While adding connectors, there was an option named
|
Yeah, the |
I'm facing the same issue in my project, any workaround meanwhile MM fix it? |
A workaround I used was to use a boolean state variable, with initial value as The |
I guess we have to wait until this is fixed for the problematic behavior to disappear MetaMask/metamask-extension#13375 |
Hi there I am having this issue on a webapp that has wagmi. Any options on how to fix this on the app - like a workaround? I use this list of networks below, it at first lets me connect to any of them. Then when I start like a transaction, it will randomnly change to whatever is the FIRST in the list, in this case bsc. Then I need to disconnect and reconnect to get it to work. Any tips would be appreciated, thank you const { chains, provider } = configureChains( const { connectors } = getDefaultWallets({ const wagmiClient = createClient({ |
any fixes yet ? |
Yup, was fixed in 0.12.6 by wevm/references#177 |
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. |
Is there an existing issue for this?
Package Version
0.2.7
Current Behavior
I added some new chains when setting up the providers.
When i use SwitchNetwork from the useNetwork hook with chains i added e.g BSC, BSC Testnet etc, the selected network and list of networks do not show any longer.
There is no error and if i refresh the page, it now shows that i am connected to the right network
Expected Behavior
SwitchNetwork should work well with default and non default chains
Steps To Reproduce
Add new chains to the provider on setup and then use the code below to select and switch between chains
Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: