web3-onboard icon indicating copy to clipboard operation
web3-onboard copied to clipboard

Error Connect to metamask

Open peterpan0708 opened this issue 1 year ago • 13 comments

Current Behavior

all popular websites using web3-onboard have this issue, eg. curve.fi, https://onboard.blocknative.com/

image image

Expected Behavior

should connect to metamask correctly

Steps To Reproduce

It's not 100% reproduce, but if you keep trying for 5 more times, it will happen

  1. open website, connect to metamask
image
  1. click disconnect button image
  2. close the website label image
  3. open the website
  4. connect to metamask image

What package is effected by this issue?

@web3-onboard/injected

Is this a build or a runtime issue?

Runtime

Package Version

latest

Node Version

18.15.0

What browsers are you seeing the problem on?

Chrome

Relevant log output

No response

Anything else?

No response

Sanity Check

  • [X] If this is a build issue, I have included my build config. If this is a runtime issue, I have included reproduction steps and/or a Minimal, Reproducible Example.

peterpan0708 avatar Jul 06 '23 08:07 peterpan0708

@peterpan0708 I tried on both site 10x across multiple browsers and was unable to reproduce. Can you create a reproducible example or video?

Adamj1232 avatar Jul 06 '23 17:07 Adamj1232

@peterpan0708 I tried on both site 10x across multiple browsers and was unable to reproduce. Can you create a reproducible example or video?

https://github.com/blocknative/web3-onboard/assets/36805830/abc81479-cedc-43cd-b8eb-2131c1becf99

peterpan0708 avatar Jul 07 '23 01:07 peterpan0708

@peterpan0708 I tried on both site 10x across multiple browsers and was unable to reproduce. Can you create a reproducible example or video?

2_1688692669.mp4

I think it's a common issue, because all of our team members can reproduce

peterpan0708 avatar Jul 07 '23 01:07 peterpan0708

@Adamj1232 more information: image our code stuck at this line go deep into the source code 41688697058_ pic requestAccounts() doesn't return

peterpan0708 avatar Jul 07 '23 02:07 peterpan0708

I'm also experiencing this error: Screenshot 2023-07-07 at 11 15 40 AM Screenshot 2023-07-07 at 11 16 56 AM

tim-schultz avatar Jul 07 '23 17:07 tim-schultz

@schultztimothy I think this is a different error than what is reported in this issue. The error you are noted we are aware of and we are troubleshooting with the walletconnect and metamask teams. Are you a dev with curve.fi?

Adamj1232 avatar Jul 07 '23 17:07 Adamj1232

@schultztimothy I think this is a different error than what is reported in this issue. The error you are noted we are aware of and we are troubleshooting with the walletconnect and metamask teams. Are you a dev with curve.fi?

Thanks for your quick response! I'm not with Curve, but am a dev on Gitcoin's passport application and we are experiencing the same issue. We recently updated to "@web3-onboard/walletconnect": "2.4.0", and are about to release the update.

I assume since you all are actively working on it we should be good to release and the issue should be patched soon? Thanks again!

tim-schultz avatar Jul 07 '23 17:07 tim-schultz

@schultztimothy we have pinpointed the issue. MetaMask when handling a connection through WalletConnect requires a URL to be passed. This previously was populated within the WalletConnect package as the web3OnboardInit.appMetaData.explorer property. I have an open PR to add a WC init prop to define this more clearly as well as enhanced validation and documentation around this. To resolve this issue in the short term please pass in the dapp URL into web3OnboardInit.appMetaData.explorer or you can wait until the noted PR is in alpha to test with the walletconnect init prop dappUrl

Adamj1232 avatar Jul 10 '23 16:07 Adamj1232

@schultztimothy we have pinpointed the issue. MetaMask when handling a connection through WalletConnect requires a URL to be passed. This previously was populated within the WalletConnect package as the web3OnboardInit.appMetaData.explorer property. I have an open PR to add a WC init prop to define this more clearly as well as enhanced validation and documentation around this. To resolve this issue in the short term please pass in the dapp URL into web3OnboardInit.appMetaData.explorer or you can wait until the noted PR is in alpha to test with the walletconnect init prop dappUrl

Hi, do you reproduce the Connecting... issue? Is there any progress? Thanks for the reply. @Adamj1232

peterpan0708 avatar Jul 11 '23 00:07 peterpan0708

@schultztimothy we have pinpointed the issue. MetaMask when handling a connection through WalletConnect requires a URL to be passed. This previously was populated within the WalletConnect package as the web3OnboardInit.appMetaData.explorer property. I have an open PR to add a WC init prop to define this more clearly as well as enhanced validation and documentation around this. To resolve this issue in the short term please pass in the dapp URL into web3OnboardInit.appMetaData.explorer or you can wait until the noted PR is in alpha to test with the walletconnect init prop dappUrl

This fix worked for us!

We are experiencing issues still with using gnosis safe's wallet. Not sure if you have had any other reports of this

tim-schultz avatar Jul 12 '23 22:07 tim-schultz

@peterpan0708 Did the release which included this PR resolve your issue?

taylorjdawson avatar Jul 21 '23 19:07 taylorjdawson

@peterpan0708 Did the release which included this PR resolve your issue?

no, this PR is about walletconnect, not reslove this issue

peterpan0708 avatar Jul 23 '23 06:07 peterpan0708

@peterpan0708 is this still an issue after updating your local version of MetaMask extension to the latest version?

Adamj1232 avatar Oct 02 '23 18:10 Adamj1232