Skip to content

@wagmi/core peer version mismatch forces CreateConnectorFn cast #258

Description

@jayeshbhole

Summary

zeroDevWallet() returns a CreateConnectorFn typed against a different copy of @wagmi/core than the one a current wagmi app resolves, so passing it to createConfig fails type-checking and requires an as unknown as CreateConnectorFn cast.

Details

A standard app on wagmi@2.19.5 resolves @wagmi/core@2.22.1. With the ZeroDev packages installed, a second @wagmi/core copy (3.5.0) ends up in the tree, and the connector is typed against it. The two CreateConnectorFn types are structurally incompatible.

pnpm why @wagmi/core confirms the split.

Reproduction

import { createConfig } from 'wagmi'
import { zeroDevWallet } from '@zerodev/wallet-react'

const connector = zeroDevWallet({ projectId, chains: [arbitrumSepolia] })

createConfig({
  chains: [arbitrumSepolia],
  connectors: [connector], // type error: incompatible CreateConnectorFn
  transports: { [arbitrumSepolia.id]: http() },
})

tsc fails. Current workaround:

const connector = zeroDevWallet({ ... }) as unknown as CreateConnectorFn

Runtime is fine; the issue is purely the type mismatch. It also surfaces as spurious editor "missing chain, account" errors on writeContract / sendTransaction even though the project tsc -b is clean.

Ask

Align the published peer/runtime @wagmi/core version with current wagmi@2.x (which ships @wagmi/core@2.22.x) so no second copy is pulled and no cast is needed. Same applies to the related @zerodev/sdk and ox version skews.

Environment

@zerodev/wallet-react@0.0.1-alpha.26, @zerodev/wallet-react-kit@0.0.1-alpha.3, wagmi 2.19.5, @wagmi/core 2.22.1 vs 3.5.0, viem 2.52.2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions