# \[Archive\] Web3Auth + MetaMask: Unable to Open Wallet UI

**URL:** <https://builder.metamask.io/t/archive-web3auth-metamask-unable-to-open-wallet-ui/1072>\
**Category:** Embedded Wallets (Web3Auth)\
**Created:** [March 12, 2025, 1:46pm UTC](https://builder.metamask.io/t/archive-web3auth-metamask-unable-to-open-wallet-ui/1072 "2025-03-12T13:46:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![uktamka](https://yyz1.discourse-cdn.com/flex011/user_avatar/builder.metamask.io/uktamka/32/82_2.png) [@uktamka](https://builder.metamask.io/u/uktamka)\
**Post date:** [March 12, 2025, 1:46pm UTC](https://builder.metamask.io/t/archive-web3auth-metamask-unable-to-open-wallet-ui/1072/1 "2025-03-12T13:46:38Z")

</div>

> **🏛 Archived Content from Web3Auth Community**
> 
> This topic was originally posted by **uktamka** on 3/12/2025.  
> This content has been migrated from our previous community forum to preserve valuable discussions.

* * *

Hi Web3Auth team,

I’m experiencing an issue when trying to connect via MetaMask using Web3Auth. The wallet UI does not open, and I see the following error in the console:

```console
Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received

```

- **SDK Version** (package.json):  
“@web3auth/modal”: “^9.7.0”,  
“@web3auth/wallet-services-plugin”: “^9.7.0”,

- **Browser Console Screenshots** :  

My code:

```typescript
const name = 'myapp'
 const chainConfig = {
   chainNamespace: CHAIN_NAMESPACES.EIP155,
   chainId: `0x${chain.id.toString(16)}`,
   rpcTarget: chain.rpcUrls.default.http[0],
   displayName: chain.name,
   tickerName: chain.nativeCurrency?.name,
   ticker: chain.nativeCurrency?.symbol,
   blockExplorerUrl: chain.blockExplorers?.default.url[0] as string
}
const privateKeyProvider = new EthereumPrivateKeyProvider({ config: { chainConfig } })
const web3authOptions: Web3AuthOptions = {
clientId: WEB3AUTH_CLIENT_ID,
chainConfig,
privateKeyProvider,
uiConfig: {
appName: name,
defaultLanguage: ‘en’,
logoLight: ${window.location.origin}/logo.svg,
logoDark: ${window.location.origin}/logo.svg,
mode: ‘auto’
},
web3AuthNetwork: ‘sapphire_devnet’,
enableLogging: true
}
const web3AuthModalInstance = new Web3Auth(web3authOptions)
const authAdapter = new AuthAdapter({
adapterSettings: {
uxMode: UX_MODE.POPUP
},
loginSettings: {
mfaLevel: ‘optional’
},
privateKeyProvider
})
const injectedAdapters = getInjectedAdapters({ options: web3authOptions })
injectedAdapters.forEach((adapter: IAdapter<unknown>) => {
web3AuthModalInstance.configureAdapter(adapter)
})
const walletServicesPlugin = new WalletServicesPlugin({
walletInitOptions: {
whiteLabel: {
showWidgetButton: false,
appName: name
}
}
})

```

---

<div class="post-metadata">

**Author:** ![morrisonvannessa](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@morrisonvannessa](https://builder.metamask.io/u/morrisonvannessa)\
**Post date:** [March 14, 2025, 8:37am UTC](https://builder.metamask.io/t/archive-web3auth-metamask-unable-to-open-wallet-ui/1072/2 "2025-03-14T08:37:04Z")

</div>

Hi there,

I am not apart of the Web3Auth team, however I think I might be able to help.

The error that you are getting, specifically this one:  
**WalletServicesPluginError: Wallet plugin is not connected Yet. Please wait for plugin to connect and listen via `connected` event on the plugin** usually means the Web3Auth plugin (WalletServicesPlugin) is trying to open or run before it’s fully initialized.

The fix is straightforward. You’re likely missing the initialization step before trying to open the wallet UI.

Here is exactly what you need to add:  
**await web3authModalInstance. initModal() ;**

Your corrected code should look like this:

// Set up Web3Auth and Wallet Plugin as you have  
web3AuthModalInstance.addPlugin(walletServicesPlugin);  
web3AuthModalInstance.configureAdapter(authAdapter);

// IMPORTANT: make sure this is awaited first!  
await web3AuthModalInstance.initModal();

// Now you can safely connect  
await web3AuthModalInstance.connect();

Also, double-check that your browser allows pop-ups (MetaMask opens as a pop-up), and make sure MetaMask is installed, unlocked, and running properly. Oh also make sure you use chrome - it works best.

Give this a try, and let me know if you’re still stuck!

---

<div class="post-metadata">

**Author:** ![shahbaz](https://yyz1.discourse-cdn.com/flex011/user_avatar/builder.metamask.io/shahbaz/32/1527_2.png) [@shahbaz](https://builder.metamask.io/u/shahbaz)\
**Post date:** [March 25, 2025, 9:43am UTC](https://builder.metamask.io/t/archive-web3auth-metamask-unable-to-open-wallet-ui/1072/3 "2025-03-25T09:43:58Z")

</div>

Hey @uktamka

Did you try @morrisonvannessa’s suggested steps?
