wevm / wagmi

React Hooks for Ethereum

Home Page:https://wagmi.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when using wagmi and @wagmi/core packages together.

heyitsarpit opened this issue · comments

commented

Describe the bug

getting this error when importing actions from @wagmi/core

"wagmi" Property '#private' in type 'Emitter' refers to a different member that cannot be accessed from within type 'Emitter'.

Link to Minimal Reproducible Example

No response

Steps To Reproduce

  • create wagmi config using createConfig imported from wagmi.
  • now import any function from @wagmi/core that requires passing the config as first argument, eg. switchChain
  • passing the config as first param to switchChain will throw a typescript error about private field access.

Wagmi Version

2.5.20

Viem Version

2.9.21

TypeScript Version

5.2.2

Check existing issues

Anything else?

No response

commented

the way to fix this for now is to import switchChain from wagmi/actions which internally is already reexporting @wagmi/core.

Hello @heyitsarpit. Please provide a minimal reproduction using new.wagmi.sh for runtime issues or TypeScript Playground for type issues. Issues marked with "needs reproduction" will be closed if they have no activity within 3 days.