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

MetaMask error code: 1013 if switch a network that not specified in the readOnlyUrls #699

Closed
IMRFeng opened this issue Apr 17, 2022 · 2 comments

Comments

@IMRFeng
Copy link

IMRFeng commented Apr 17, 2022

Hi there,

When I play with the example https://example.usedapp.io/balance, I keep getting the below error if I switch the network to any chain that is not specified in the readOnlyUrls. For instance, in the example code, only Mainnet, Ropsten, Kovan, and Arbitrum are assigned to the readOnlyUrls in the config, if you switch between those networks, it's working fine, but if you choose other networks like Aribitrum, Matic or BSC it's gonna throw the error.

I'm not sure whether it's the feature or a bug, thanks.

{
  "code": 1013,
  "message": "MetaMask: Disconnected from chain. Attempting to connect.",
  "stack": "Error: MetaMask: Disconnected from chain. Attempting to connect.\n at l._handleDisconnect (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:39838)\n at l._handleDisconnect (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:43644)\n at l._handleChainChanged (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:40445)\n at l._handleChainChanged (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:45560)\n at o.<anonymous> (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:38011)\n at i (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:54745)\n at o.emit (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:55285)\n at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:53809\n at f.write [as _write] (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:53832)\n at w (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:17:29867)"
}

Above error got tested by using Chrome Version 100.0.4896.127 (Official Build) (arm64) + MetaMask

Just tried on Brave and Brave wallet, looks like everything works fine on it 🤔

@yivlad
Copy link
Collaborator

yivlad commented Jun 7, 2022

Hey,

the problem might be caused by this bug in Metamask. Could you please update to the latest useDApp, set noMetamaskDeactivate: true in your DAppConfig and let us know if this works?

@IMRFeng
Copy link
Author

IMRFeng commented Jun 21, 2022

Hey,

the problem might be caused by this bug in Metamask. Could you please update to the latest useDApp, set noMetamaskDeactivate: true in your DAppConfig and let us know if this works?

Hi @yivlad , yep, noMetamaskDeactivate: true works like a charm, thanks. I'll close this now

@IMRFeng IMRFeng closed this as completed Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants