WalletConnect modal does not appear when using a fallback to unstable_connector(injected)
#4169
Closed
1 task done
unstable_connector(injected)
#4169
Check existing issues
Describe the bug
Version 0.0.32 of the @wagmi/vue package introduces a bug where the WalletConnect modal does not appear when using a fallback to
unstable_connector(injected)
. This issue does not occur in version 0.0.31.I'm too unfamiliar with the codebase to submit a PR.
Link to Minimal Reproducible Example
https://github.com/0xAlunara/walletconnect-no-modal.
Steps To Reproduce
vite dev
.What Wagmi package(s) are you using?
@wagmi/vue
Wagmi Package(s) Version(s)
@wagmi/vue@0.0.32
Viem Version
2.18.0
TypeScript Version
5.5.4
Anything else?
Expected Behavior:
The WalletConnect QR modal should pop up, allowing users to connect their wallets.
Actual Behavior:
The WalletConnect QR modal does not appear. No console errors are shown, but the front-end displays an error:
Cannot read properties of undefined (reading 'url').
Bug Introduction
The changelog for version 0.0.32 indicates added functionality for consumer-defined RPC URLs to be propagated to the WalletConnect & MetaMask Connectors, which likely introduced this bug.
Temporary Workaround:
Change the code in
wagmi.ts
from:to:
This bypasses the issue but is not a permanent fix.
Error Stacktrace:
Potential Cause:
The issue is identified in
wagmi_vue_connectors.js
:In
extractRpcUrls.js
:return transports.map(({ value }) => value.url || fallbackUrl);
The variable value is undefined in some cases, specifically when using unstable_connector(injected) which does not have an RPC specified. Perhaps a fix would be to change
value.url
intovalue?.url
?The text was updated successfully, but these errors were encountered: