wevm / wagmi

React Hooks for Ethereum
https://wagmi.sh
MIT License
5.79k stars 968 forks source link

Duplicate identifier "Register" #4069

Closed AlansaladA closed 2 weeks ago

AlansaladA commented 2 weeks ago

Check existing issues

Describe the bug

The document says that the type of merged config is like this: declare module "wagmi" { interface Register { config: typeof config } }

It was working before, but now it gives an error: Duplicate identifier "Register". ts(2300) index.d.ts(77, 692): "Register" is also declared here.

Then I noticed that Register is defined as a type in the new version. How should I declare the type of config now? I don’t want to introduce it in the hook every time.

Link to Minimal Reproducible Example

No response

Steps To Reproduce

No response

What Wagmi package(s) are you using?

wagmi

Wagmi Version

2.10.2

Viem Version

2.x

TypeScript Version

5.4.3

Anything else?

No response

github-actions[bot] commented 2 weeks ago

Hello @AlansaladA.

Please provide a minimal reproduction using StackBlitz, TypeScript Playground (for type issues), or a separate minimal GitHub repository.

Minimal reproductions are required as they save us a lot of time reproducing your config/environment and issue, and allow us to help you faster.

Once a minimal reproduction is added, a team member will confirm it works, then re-open the issue.

dalechyn commented 2 weeks ago

could reproduce it with typescript@rc: https://github.com/dalechyn/wagmi-register-type-issue

AlansaladA commented 2 weeks ago

could reproduce it with typescript@rc: https://github.com/dalechyn/wagmi-register-type-issue

They have fixed it in version 2.10.4🙂

github-actions[bot] commented 2 days ago

This issue has been locked since it has been closed for more than 14 days.

If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest Wagmi version. If you have any questions or comments you can create a new discussion thread.