Skip to content
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

bug: Unpredictable disconnect Metamask #1239

Closed
1 task done
Nikitulb opened this issue Nov 5, 2022 · 2 comments
Closed
1 task done

bug: Unpredictable disconnect Metamask #1239

Nikitulb opened this issue Nov 5, 2022 · 2 comments

Comments

@Nikitulb
Copy link
Contributor

Nikitulb commented Nov 5, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Package Version

0.7.12

Current Behavior

  1. Connect with Metamask
  2. Select another chain in extension (ex. BSC) - everything is ok
  3. Select Arbitrum chain in extension - you will be disconnected and wagmi store clean active connector

Expected Behavior

  1. Connect with Metamask
  2. Select another chain in extension (ex. BSC) - everything is ok
  3. Select Arbitrum chain in extension - everything is ok

Steps To Reproduce

  1. Connect with Metamask
  2. Select another chain in extension (ex. BSC)
  3. Select Arbitrum (Optimism) chain in extension

Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)

https://wagmi.sh/examples/connect-wallet

Anything else?

Params for Arbitrum Network

@tmm
Copy link
Member

tmm commented Nov 5, 2022

This is a known issue with MetaMask, where a "disconnect" event is emitted when you switch from MetaMask's default networks to custom networks.

wagmi patches this behavior with the shimChainChangedDisconnect flag, but it unfortunately doesn't work when switching networks from the browser extension.

Copy link
Contributor

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.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants