unionlabs/union · error · Error

Connector ${evmWalletId} not found

Error message

Connector ${evmWalletId} not found

What it means

evmConnect resolves a wallet id against wagmi's configured connectors (a list already filtered by excludeWalletList) and throws when find() returns nothing. It means wagmi has no live connector registered under that id: the wallet is not installed, was excluded from the config, or the id string no longer matches this wagmi version's connector ids.

Source

Thrown at app2/src/lib/wallet/evm/config.svelte.ts:248

        ? "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='-14.94' y1='914.64' x2='1159.05' y2='-86.81' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%2312ff80'/%3E%3Cstop offset='.13' stop-color='%2315fd85'/%3E%3Cstop offset='.29' stop-color='%231ff896'/%3E%3Cstop offset='.49' stop-color='%2330f1b2'/%3E%3Cstop offset='.69' stop-color='%2348e7d9'/%3E%3Cstop offset='.87' stop-color='%235fddff'/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx='500' cy='500' r='500' fill='url(%23g)'/%3E%3Cpath fill='%23121312' d='M780.07 499.81h-68.31a36.93 36.93 0 0 0-36.93 36.93v99.14a36.93 36.93 0 0 1-36.93 36.93H366.13a36.93 36.93 0 0 0-36.93 36.93v68.31a36.93 36.93 0 0 0 36.93 36.93h287.5a36.93 36.93 0 0 0 36.71-36.93v-54.8a34.88 34.88 0 0 1 36.93-34.88h52.8a36.93 36.93 0 0 0 36.93-36.93v-115.14a36.5 36.5 0 0 0-36.93-36.5Z'/%3E%3Cpath fill='%23121312' d='M329.18 364.11a36.93 36.93 0 0 1 36.93-36.93h271.6a36.93 36.93 0 0 0 36.93-36.93v-68.31a36.93 36.93 0 0 0-36.93-36.93H350.37a36.93 36.93 0 0 0-36.93 36.93v52.63a36.93 36.93 0 0 1-36.93 36.93h-52.57a36.93 36.93 0 0 0-36.93 36.93v115.26a36.1 36.1 0 0 0 37 36.1h68.31a36.93 36.93 0 0 0 36.93-36.93l-.06-98.74Z'/%3E%3Cpath fill='%23121312' d='M469.85 428.01h65.62a38.74 38.74 0 0 1 38.74 38.74v65.62a38.74 38.74 0 0 1-38.74 38.74h-65.62a38.74 38.74 0 0 1-38.74-38.74v-65.62a38.74 38.74 0 0 1 38.74-38.74Z'/%3E%3C/svg%3E"
        : connector.icon) as string,
      type: connector.type as ConnectorType,
      download: "",
    }
  })
  .filter(wallet => !excludeWalletList.includes(wallet.id)) satisfies Array<Connector>

export type EvmWalletId = (typeof evmWalletsInformation)[number]["id"]

export async function evmConnect(
  evmWalletId: EvmWalletId,
  chainId: ConfiguredChainId = mainnet.id,
) {
  const connector = getWagmiConfig().connectors.find(connector => connector.id === evmWalletId)
  if (connector) {
    return await _connect(getWagmiConfig(), { connector, chainId })
  }
  throw new Error(`Connector ${evmWalletId} not found`)
}

export async function evmDisconnect() {
  try {
    const connector = getAccount(getWagmiConfig()).connector
    if (connector) {
      await _disconnect(getWagmiConfig(), { connector })
    } else {
      await _disconnect(getWagmiConfig())
    }
  } catch (error) {
    console.error("Error during disconnect:", error)
    throw error
  }
}

export const evmSwitchChain = (chainId: ConfiguredChainId) =>
  _switchChain(getWagmiConfig(), { chainId })

View on GitHub (pinned to 031785bb6d)

Solutions

  1. Before calling evmConnect, check getWagmiConfig().connectors for the id and only render selectable wallets that are actually present
  2. Clear or re-map persisted wallet ids after wagmi upgrades (connector ids changed in wagmi v2)
  3. Verify the wallet's browser extension is installed and enabled for the site
  4. Fall back to the injected connector when the requested one is missing

Example fix

// before
await evmConnect(walletId)

// after
const available = new Set(getWagmiConfig().connectors.map(c => c.id))
if (!available.has(walletId)) {
  notify(`Wallet ${walletId} is unavailable. Is the extension installed?`)
  return
}
await evmConnect(walletId)
Defensive patterns

Strategy: validation

Validate before calling

const connectorIds = new Set(getWagmiConfig().connectors.map(c => c.id))

if (!connectorIds.has(evmWalletId)) {
  notify(`Wallet ${evmWalletId} is unavailable — is it installed?`)
  return
}
await evmConnect(evmWalletId)

Type guard

const isAvailableEvmWallet = (id: string): id is EvmWalletId =>
  getWagmiConfig().connectors.some(c => c.id === id)

Try / catch

try {
  await evmConnect(walletId)
} catch (e) {
  if (e instanceof Error && /Connector .* not found/.test(e.message)) {
    notify("Wallet not detected. Install the extension or pick another wallet.")
    return
  }
  throw e
}

Prevention

When it happens

Trigger: User selects a wallet absent from getWagmiConfig().connectors (extension not installed, mobile browser with no injected provider, wallet disabled via excludeWalletList), or a persisted wallet id from localStorage that wagmi no longer uses after an upgrade (e.g. 'metaMask' vs wagmi v2's 'io.metamask').

Common situations: wagmi v1 to v2 migrations renaming connector ids; stale localStorage 'last connected wallet'; wallets filtered out by the app's excludeWalletList; mobile browsers where only the embedded wallet exists.

Related errors


AI-assisted analysis of unionlabs/union@031785bb6d (2026-08-16). Data as JSON: /api/errors/7509c7cfe5a613c8. Report an issue: GitHub.