# \[Archive\] Web3AuthNoModal failing - failing and asking for rpcTarget param to be specified when it already is

**URL:** <https://builder.metamask.io/t/archive-web3authnomodal-failing-failing-and-asking-for-rpctarget-param-to-be-specified-when-it-already-is/1909>\
**Category:** Embedded Wallets (Web3Auth)\
**Created:** [June 27, 2023, 2:03pm UTC](https://builder.metamask.io/t/archive-web3authnomodal-failing-failing-and-asking-for-rpctarget-param-to-be-specified-when-it-already-is/1909 "2023-06-27T14:03:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeanlouis](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jeanlouis](https://builder.metamask.io/u/jeanlouis)\
**Post date:** [June 27, 2023, 2:03pm UTC](https://builder.metamask.io/t/archive-web3authnomodal-failing-failing-and-asking-for-rpctarget-param-to-be-specified-when-it-already-is/1909/1 "2023-06-27T14:03:43Z")

</div>

> **🏛 Archived Content from Web3Auth Community**
> 
> This topic was originally posted by **jeanlouis** on 6/27/2023.  
> This content has been migrated from our previous community forum to preserve valuable discussions.

* * *

**Please provide the following details too when asking for help in this category:**

- SDK Version: ^6.1.1

- Platform: Remix.js/React.js

- Browser Console Screenshots:  

- Related to Custom Authentication? Please provide the following info too: **(Optional)**

**Please provide the Web3Auth initialization and login code snippet below:**  
Example from your documentation at [Wallet Connect V2 Adapter | Documentation | Web3Auth](https://web3auth.io/docs/sdk/pnp/web/adapters/wallet-connect-v2)

Attempted this:

```auto
  const web3auth = new Web3AuthNoModal({
    clientId: WEB_3_AUTH_CLIENT_ID,
        chainConfig: {
          chainNamespace: CHAIN_NAMESPACES.EIP155,
          chainId: `0x${Number(getDefaultChainId()).toString(16)}`,
          rpcTarget:
            'https://<subdomain>.quiknode.pro/<slug>/',
        },
  });
useEffect(() => {
(async () => {
const defaultWcSettings = await getWalletConnectV2Settings(
‘eip155’,
[1, 5, 137],
‘project_id’
);
console.log(‘web3auth’);
const walletConnectV2Adapter = new WalletConnectV2Adapter({
…defaultWcSettings,
});
console.log(‘web3auth’);
// //
web3auth.configureAdapter(walletConnectV2Adapter);
await web3auth.init();
})();
}, );

```

and this:  
Attempted this:

```auto
  const web3auth = new Web3AuthNoModal({
    clientId: WEB_3_AUTH_CLIENT_ID,
  chainConfig: {
    chainNamespace: CHAIN_NAMESPACES.EIP155,
    chainId: `0x${Number(getDefaultChainId()).toString(16)}`,
    rpcTarget:
      'https://<subdomain>.quiknode.pro/<slug>/',
  },
  });
useEffect(() => {
(async () => {
const defaultWcSettings = await getWalletConnectV2Settings(
‘eip155’,
[1, 5, 137],
‘project_id’
);
console.log(‘web3auth’);
const walletConnectV2Adapter = new WalletConnectV2Adapter({
…defaultWcSettings,
chainConfig: { //<– passing in chainConfig as error suggests
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: 0x${Number(getDefaultChainId()).toString(16)},
rpcTarget:
‘https://<subdomain>.quiknode.pro/<slug>/’,
},
});
console.log(‘web3auth’);
// //
web3auth.configureAdapter(walletConnectV2Adapter);
await web3auth.init();
})();
}, );

```

Same result.

Please update your docs, or provide guidance, this crashes the whole flow which prevents other connectors from working properly

---

<div class="post-metadata">

**Author:** ![jeanlouis](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jeanlouis](https://builder.metamask.io/u/jeanlouis)\
**Post date:** [June 27, 2023, 2:08pm UTC](https://builder.metamask.io/t/archive-web3authnomodal-failing-failing-and-asking-for-rpctarget-param-to-be-specified-when-it-already-is/1909/2 "2023-06-27T14:08:30Z")

</div>

I went through the flow of the .init call, that’s where it seems to be failing.

Couple of things:

- i noticed the WalletConnectV2 provider fetches the defaultWcSettings internally to the .init call, perhaps manually calling getWalletConnectV2Settings should not be necessary
- i noticed the .init call iterates over all adapters’ .init calls, and passes in its own chainOptions containing the chainConfig

there’s clearly somewhere not passing in the chainConfig properly

---

<div class="post-metadata">

**Author:** ![jeanlouis](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jeanlouis](https://builder.metamask.io/u/jeanlouis)\
**Post date:** [June 27, 2023, 2:09pm UTC](https://builder.metamask.io/t/archive-web3authnomodal-failing-failing-and-asking-for-rpctarget-param-to-be-specified-when-it-already-is/1909/3 "2023-06-27T14:09:21Z")

</div>

FYI  
removing all code related to WalletConnectV2 makes the other adapters work - so it’s clearly something around the WalletConnectV2 init flow

---

<div class="post-metadata">

**Author:** ![vjgee](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@vjgee](https://builder.metamask.io/u/vjgee)\
**Post date:** [June 27, 2023, 7:38pm UTC](https://builder.metamask.io/t/archive-web3authnomodal-failing-failing-and-asking-for-rpctarget-param-to-be-specified-when-it-already-is/1909/4 "2023-06-27T19:38:00Z")

</div>

@jeanlouis Thanks for reaching out.

Your issue has been forwarded to our team and we will get back with further updates.

---

<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:** [June 28, 2023, 2:59am UTC](https://builder.metamask.io/t/archive-web3authnomodal-failing-failing-and-asking-for-rpctarget-param-to-be-specified-when-it-already-is/1909/5 "2023-06-28T02:59:08Z")

</div>

Hey @jeanlouis

Web3Auth No-Modal requires a `privateKeyProvider` during initialization.

[check the announcement note](https://community.web3auth.io/t/web3auth-pnp-web-v6-is-here-with-exciting-updates/4486) for more details.

> [@Web3Auth PnP Web v6 is here with exciting updates!](https://web3auth.io/community/t/web3auth-pnp-web-v6-is-here-with-exciting-updates/4486/1):
>
> if you are using `@web3auth/no-modal, the openlogin-adapter needs a `privateKeyProvider` during initialization.

Also, refer to [any no-modal example here](https://github.com/Web3Auth/web3auth-pnp-examples/tree/main/web-no-modal-sdk/blockchain-connection-examples/evm-no-modal-example) for reference.

---

<div class="post-metadata">

**Author:** ![jeanlouis](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jeanlouis](https://builder.metamask.io/u/jeanlouis)\
**Post date:** [June 28, 2023, 1:57pm UTC](https://builder.metamask.io/t/archive-web3authnomodal-failing-failing-and-asking-for-rpctarget-param-to-be-specified-when-it-already-is/1909/6 "2023-06-28T13:57:03Z")

</div>

understood - however, im not using an OpenLoginAdapter, only Metamask, Coinbase and WalletConnect; the note in the anouncement you’re referring to mentions the privateKeyProvider only if using open-login (which im not); additionally, when removing wallet connect adapter code, the NoModal initializer works without a privateKeyProvider so i don’t believe the NoModal sdk requires one just for logging-in users

---

<div class="post-metadata">

**Author:** ![jeanlouis](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jeanlouis](https://builder.metamask.io/u/jeanlouis)\
**Post date:** [June 28, 2023, 3:33pm UTC](https://builder.metamask.io/t/archive-web3authnomodal-failing-failing-and-asking-for-rpctarget-param-to-be-specified-when-it-already-is/1909/7 "2023-06-28T15:33:45Z")

</div>

i’ve isolated the issue in your SDK,

in this code snippet:

[![image](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/2X/0/089190ef020a90e893d7bb3add7c38c777731cf5.png)
image1704×350 29.2 KB
](https://community.web3auth.io/community/community/uploads/default/original/2X/5/5b6eb06363a22f7a7ada5056fc2e00aa9aa514b6.png "image")

chainConfig somehow does not get applied properly

when this is passed in, I’m not seeing neither my values from options.chainConfig, neither your default values from getChainConfig

I checked the esm.js code this generates, and the spread operator function generated to handle this spread block is pretty thick to decypher

I’d recommend your team look into this part
