Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Cannot read properties of undefined (reading 'chainId') #59

Open
ArturVargas opened this issue Mar 22, 2023 · 4 comments
Open

Cannot read properties of undefined (reading 'chainId') #59

ArturVargas opened this issue Mar 22, 2023 · 4 comments

Comments

@ArturVargas
Copy link

Describe the bug
When connect with Magic Link works fine in avalanche network, but when I try to sing a transaction I get an error about chainId is undefined

To Reproduce
Steps to reproduce the behavior:

  1. Click on Connect Wallet Button
  2. Connect with Magic
  3. Try to approve contract
  4. Get an error

Expected behavior
Expected to approve ERC20 transaction works correctly

Screenshots
Captura de pantalla 2023-03-22 a la(s) 14 34 02

Desktop (please complete the following information):

  • OS: MacOS Ventura 13.2.1
  • Browser Google Chrome Version 111.0.5563.64

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
rpcUrl: "https://api.avax.network/ext/bc/C/rpc"
chainid: 43114

Dependencies:
"@everipedia/wagmi-magic-connector": "^0.10.1",
"@rainbow-me/rainbowkit": "^0.12.2",
"ethers": "^5.7.0",
"next": "^13.0.0",
"react": "^18.2.0",
"react-bootstrap": "^2.7.1",
"react-dom": "^18.2.0",
"wagmi": "^0.12.2"

@Royal-lobster
Copy link
Member

Hello ! thanks for opening issue. May i know how you are initialising the connector ?

@ArturVargas
Copy link
Author

Hi @Royal-lobster thanks for you response

Connector Code:

Captura de pantalla 2023-03-23 a la(s) 10 51 42

Captura de pantalla 2023-03-23 a la(s) 10 52 04

@PovedaAqui
Copy link
Contributor

It doesn't work with the Avalanche chain, according to the Magic.link documentation, some modifications are needed.

@ArturVargas
Copy link
Author

It doesn't work with the Avalanche chain, according to the Magic.link documentation, some modifications are needed.

In the doc they specify that sdk is for X-Chain, for C-chain (contracts chain EVM) in this part https://magic.link/docs/auth/blockchains/avalanche#initializing-extension they refer to this https://magic.link/docs/auth/blockchains/ethereum/javascript#configure-custom-nodes

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants