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

Deprecated event listener #4786

Closed
1 task done
antonio-fr opened this issue Feb 19, 2022 · 1 comment · Fixed by #4839
Closed
1 task done

Deprecated event listener #4786

antonio-fr opened this issue Feb 19, 2022 · 1 comment · Fixed by #4839
Labels
1.x 1.0 related issues

Comments

@antonio-fr
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Running web3.js with Metamask, the latter informs with a warning that the "close" may be removed in any future version.

new window.Web3(window.ethereum)

➡️
MetaMask: The event 'close' is deprecated and may be removed in the future. Please use 'disconnect' instead.
For more information, see: https://eips.ethereum.org/EIPS/eip-1193#disconnect

_warnOfDeprecation @ inpage.js:1
on @ inpage.js:1
u.setProvider @ web3.js:15
e @ web3.js:15
packageInit @ web3.js:3
d @ web3.js:15
Web3Wallet @ wallet.js...
startWeb3 @ xxx

Expected Behavior

Should use a current method, not a deprecated one.

Steps to Reproduce

Use dist/web3.min.js v1.7.0 in a browser with Metamask :
new window.Web3(window.ethereum)

Web3.js Version

1.7.0

Environment

  • Operating System: Win10
  • Browser: Chromium 97.0.4692.71
  • Node.js Version: 16.13.0
  • NPM Version: 8.1.0

Anything Else?

No response

@antonio-fr antonio-fr added the Bug Addressing a bug label Feb 19, 2022
@jdevcs jdevcs added the 1.x 1.0 related issues label Feb 21, 2022
@jdevcs
Copy link
Contributor

jdevcs commented Feb 21, 2022

@antonio-fr thanks for mentioning it, 1.x is already handling this case. could you go ahead and open PR for removing close.

@jdevcs jdevcs removed the Bug Addressing a bug label Feb 21, 2022
antonio-fr added a commit to antonio-fr/web3.js that referenced this issue Mar 2, 2022
and only let disconnect.
Following web3#4786
antonio-fr added a commit to antonio-fr/web3.js that referenced this issue Mar 6, 2022
and only let disconnect.
Following web3#4786
jdevcs pushed a commit that referenced this issue Mar 10, 2022
@jdevcs jdevcs linked a pull request Mar 10, 2022 that will close this issue
16 tasks
jdevcs added a commit that referenced this issue Mar 17, 2022
* Now we can remove the close event (#4825)

Following #4786

* Update CHANGELOG.md

Co-authored-by: antonio-fr <7551901+antonio-fr@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x 1.0 related issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants