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

Can't get MagicConnectConnector to work in connectors array #53

Open
thejasondt opened this issue Feb 15, 2023 · 4 comments
Open

Can't get MagicConnectConnector to work in connectors array #53

thejasondt opened this issue Feb 15, 2023 · 4 comments

Comments

@thejasondt
Copy link

thejasondt commented Feb 15, 2023

I am getting the following error when I try and use this package:

Does anyone know how to solve this? It is in a .ts file.

https://wagmi.sh/examples/connect-wallet

Type error: Type 'MagicConnectConnector' is not assignable to type 'Connector<any, any, any>'.
Property 'onAccountsChanged' is protected but type 'MagicConnector' is not a class derived from 'Connector<Provider, Options, Signer>'.

// Magic Connect integration 
import { MagicConnectConnector } from '@everipedia/wagmi-magic-connector';
export const client = createClient({
  autoConnect: true,
  connectors: [
    new MetaMaskConnector({ chains }),
    new MagicConnectConnector({
      chains,
      options: {
        apiKey: key, //required
      }
    })
  ],
  provider,
  webSocketProvider,
})

wagmi@0.11.5
@everipedia/wagmi-magic-connector@0.10.0

@thejasondt
Copy link
Author

The issue seems to be a lack of compatibility in .ts/.tsx files. Any idea how to get it to work without converting files to js/jsx?

The same issue occurs when trying to call connector.magicSDK within ts/tsx.

@axantillon
Copy link

I ran into this just now, you can express the connector to be parsed 'as Connector', imported from wagmi and the error will go away.

But I did have to convert to .jsx from .tsx because there are a lot of mismatching types on other properties.

@Royal-lobster
Copy link
Member

Is this still a issue with @everipedia/wagmi-magic-connector@0.12.1 ?

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

4 participants
@thejasondt @axantillon @Royal-lobster and others