You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.
Connecting with Metamask results in the error from viem: "InvalidAddressError: Address 'Undefined' is invalid."
I traced the cause to the getAccount method of magicConnector.js.
Basically there are no connected accounts according to Magic:
In the console there's an error that got me into digging deeper, the error is "webcrypto error TypeError: SubtleCrypto.sign: Argument 2 does not implement interface CryptoKey". So I think i got almost to the root of the problem, in this file from magic js v17.1.3 (the dep of the latest version of wagmi-magic-connector) there's a weak null check for the public key, infact in my localstorage that key is an empty object {}, thus the null check fails and an undefined key is fetched file source . This results in calling the suble.sign function with an undefined key, hence the error in the console.
How can I avoid this? I assume it's either an undiscovered bug or an issue with my wagmi / connector configuration.
The error can also be triggered by invoking this function, it will fail on getAddress, cause accounts array is always empty when I connect with MetaMask (connection actually fails).
Cannot connect with MetaMask using Magic Connect Connector
Issue example: https://codesandbox.io/s/fragrant-firefly-yscg8s?file=/src/App.js
Connecting with Metamask results in the error from viem:
"InvalidAddressError: Address 'Undefined' is invalid."
I traced the cause to the getAccount method of magicConnector.js.
Basically there are no connected accounts according to Magic:
In the console there's an error that got me into digging deeper, the error is
"webcrypto error TypeError: SubtleCrypto.sign: Argument 2 does not implement interface CryptoKey"
. So I think i got almost to the root of the problem, in this file from magic js v17.1.3 (the dep of the latest version of wagmi-magic-connector) there's a weak null check for the public key, infact in my localstorage that key is an empty object{}
, thus the null check fails and an undefined key is fetched file source. This results in calling the suble.sign function with an undefined key, hence the error in the console.
How can I avoid this? I assume it's either an undiscovered bug or an issue with my wagmi / connector configuration.
Additional context
my libs:
My config:
The error can also be triggered by invoking this function, it will fail on getAddress, cause accounts array is always empty when I connect with MetaMask (connection actually fails).
To Reproduce
Steps to reproduce the behavior:
Expected behavior
When I connect with MetaMask an address is found and I can use the wallet.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: