How to reproduce:
- Connect metamask with QR (or wallet connect QR but with metamask mobile app)
- Put other chain data to
chain parameter in WalletConnectModal. If the chain is undefined, then don't put "locked chains" (the locked chains list below) in the first element of chains
- Switch your metamask wallet connected chain to any chain other than the "locked chains"
- Call
wallet.switchChain(...) to "locked chains".
- It will cause error
May not specify default Metamask chain.

Locked Chains List
- Eth Mainnet
- Eth Sepolia
- Linea
- Linea Sepolia

Issue Detail
In thirdweb if the chain is not included in approved list, then the flow is:
- Call
wallet_addEthereumChain
- Call
wallet_switchEthereumChain
In this case, metamask will throw error if you try to call wallet_addEthereumChain with arg of either one of the locked chains.
Another Related Issue
thirdweb uses @walletconnect/ethereum-provider under the hood to create the provider that also saves the approved chains list.
This library will only include the below ids as approved:
- provided chainId from
chain props
- the current connected chain that user have in their metamask
This makes an issue where if the app is multichain, for example Sepolia and Ozean, and the app wants the user to connect to Ozean first, then we need to put Ozean as the chain props.
Which in turn will create an error when the user wants to switch to Sepolia.
How to reproduce:
chainparameter inWalletConnectModal. If thechainis undefined, then don't put "locked chains" (the locked chains list below) in the first element ofchainswallet.switchChain(...)to "locked chains".May not specify default Metamask chain.Locked Chains List
Issue Detail
In
thirdwebif the chain is not included inapprovedlist, then the flow is:wallet_addEthereumChainwallet_switchEthereumChainIn this case, metamask will throw error if you try to call
wallet_addEthereumChainwith arg of either one of the locked chains.Another Related Issue
thirdwebuses@walletconnect/ethereum-providerunder the hood to create the provider that also saves theapprovedchains list.This library will only include the below ids as
approved:chainpropsThis makes an issue where if the app is multichain, for example Sepolia and Ozean, and the app wants the user to connect to Ozean first, then we need to put Ozean as the
chainprops.Which in turn will create an error when the user wants to switch to Sepolia.