Cannot connect to Metamask through integrating web3modal with chrome extension
See original GitHub issueDescribe the bug Trying to integrate web3model with chrome extension wallet, and I have Metamask in my browser but at the same time the web3modal is not able to read it and it outputs a page for installing MM.
SDK Version
"@web3modal/ethereum": "^2.0.0-alpha.4",
"@web3modal/react": "^2.0.0-alpha.4",
"react": "^16.13.1",
To Reproduce Steps to reproduce the behavior:
- click on connect wallet button
- choose MM button
- then it will appear the page of installing MM
Expected behavior To open MM extension in the same browser
Screenshots
Desktop (please complete the following information):
- OS: [e.g. Arch Linux]
- Browser [e.g. chrome, brave]
Smartphone (please complete the following information):
Additional context
Issue Analytics
- State:
- Created a year ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Unable to connect MetaMask extension to Web3 site
Hi, I have problem connecting to my METAMASK wallet (extention in Chrome / brave). I just get this spinning wheel. I have tried...
Read more >Issue in web3modal integration - General - OpenZeppelin Forum
Hi all, I am facing some conflict with integrating web3modal with my reactapp. ... and Injected web3 (metamask in chrome extension also working...
Read more >One-click Login with Blockchain: A MetaMask Tutorial - Toptal
This article introduces a new login method to blockchain development: A one-click, cryptographically-secure login flow using the MetaMask extension, ...
Read more >How to Connect your Smart Contracts to Metamask - YouTube
We learn exactly how web3 / blockchain / smart contract applications work in the front end using HTML and Javascript. We then go...
Read more >Next.js with Web3Modal Example - DEV Community
Connect to an Ethereum wallet using Next.js! ... order for the Web3Modal to work in your browser, you'll need the MetaMask Chrome extension, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Don’t think there is anything we can do here on our end. Under the hood we are using wagmi (https://wagmi.sh/) for connection which in turn uses plain ethersjs / window.ethereum, so perhaps these are having issues of looking for mm outside of the extension? Could be something to do with how extension persmissions work with
window
object, not sureHi @IljaDaderko,
Thanks for helping on resolving that, and sorry for pausing on this issue for a while.
Packages
I finished updating all the packages including
react
to18.2.0
:And installed the latest versions for
web3modal
:Issue
But unfortunately still getting the same issue where Metamask button in Web3Modal in my extension, can’t reach out to my Metamask extension installed in the same browser, as you can see from the screenshot below:
Re-produce the issue
I tried also to make it easier for you to reproduce this issue. I forked this react chrome extension repo (https://github.com/iskdrews/chrome-extension-web3modal-boilerplate-react) which has
react v17
and installed the latestweb3modal
, and got the same issue after building it.Here are the steps to reproduce the same issue in your end:
npm install
npm build
chrome://extensions/
from your chrome browser ii. Check Developer mode iii. Click on Load unpacked extension iv. Select thebuild
folder.Potential solution
I think you need to integrate this package (https://github.com/MetaMask/extension-provider) for reaching out to Metamask extension provider from another WebExtensions. As you can see from this script (https://github.com/MetaMask/extension-provider/blob/master/index.js) it tries to create a connection stream to the Metamask chrome extension, so I think that might solve this issue.
Thanks in advance!