Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: type Address is not correctly picked even after configuring underlying AddressType #1712

Closed
1 task done
technophile-04 opened this issue Jan 24, 2023 · 6 comments
Closed
1 task done
Assignees

Comments

@technophile-04
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Package Version

0.10.10

Current Behavior

As mentioned in this comment #1330 (comment) if you try to configure the underlying AddressType it works but things such as type ConnectorData (specifically stuff from wagmi/connectors) still have types as 0x{string}.

Expected Behavior

Once configured the underlying AddressType to string as mentioned in #1330 (comment) it should be reflected everywhere.

Steps To Reproduce

Example repo link: https://github.com/technophile-04/se-2/tree/issue/wagmi

if you clone the repo checkout to issue/wagmi branch and go to BurnerConnector.ts you will find some typescript errors because in some places AdressType still refers to 0x{string} even after adding the declaration file.

Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)

https://github.com/technophile-04/se-2/tree/issue/wagmi

Anything else?

I think the reason for this is how wagmi is handling dependency of 'abitype'(I may be wrong here though) , checkout below SS :
Screenshot 2023-01-23 at 12 38 10 PM
The above SS is of node_modules of nexjsdirectory. As we can see the core does not have abitype in its node_modules and thus using the abitype from our repo and using anything from core is inferring correct type for AddressType : string but if we look at connectors directory in above SS there is abitype in its node_modules because of which its taking abitype from its directory instead of targeting abitype of our repo. Since importing stuff from connectors in BurnerConnector.ts the types for AddressTypes there are 0x{string}.

can this line be causing issue in wagmi ? https://github.com/wagmi-dev/wagmi/blob/b846be6b1a3c0a6c967dc22c3fde7d3acdbf0607/tsconfig.json#L27

For more description checkout scaffold-eth/scaffold-eth-2#96 (comment)

@tmm
Copy link
Member

tmm commented Jan 24, 2023

Thanks for reporting! Seems like there is a version mismatch between packages. Created wevm/references#74 that should fix this once rolled out downstream.

Aside: Noticed the TypeScript version in the project you shared does not meet minimum required for wagmi. Should be at least 4.7.4 (currently 4.7.2).

@tmm
Copy link
Member

tmm commented Jan 24, 2023

Fixed https://github.com/technophile-04/se-2/pull/1

@tmm tmm closed this as completed Jan 24, 2023
@technophile-04
Copy link
Contributor Author

Thanks so much @tmm 🙌

@meltingice
Copy link

meltingice commented Apr 19, 2023

This bug has returned. wagmi@0.12.10 depends on abitype@^0.7.1 whereas @wagmi/connectors and @wagmi/core depend on abitype@^0.3.0.

@tmm
Copy link
Member

tmm commented Apr 19, 2023

@meltingice will have a fix shortly. in the future, feel free to create a new issue. going to eliminate this issue from creeping up in the future with some upcoming changes.

Copy link
Contributor

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 other comments you can create a new discussion.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 11, 2024
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

3 participants