-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
BigInt serialization issue in useReadContract/useReadContracts hooks #4322
Comments
Hello @nakedfool. 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. |
Also running into this as of today. Might be helpful @nakedfool #3855 Here's my MRE https://github.com/wkocjan/nouns-flows/pull/25/files Edit: |
Opened a fix: TanStack/query#8151 |
Please upgrade to |
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. |
Check existing issues
Describe the bug
After updating
@tanstack/react-query
to version 5.59.0, I've encountered a critical issue with theuseReadContract
anduseReadContracts
hooks from wagmi.When attempting to pass a
BigInt
value as an argument to any read function, the following error occurs:typeerror: do not know how to serialize a bigint
This error also leads to unexpected behaviour from hook:
There is a discussion already on wagmi discord and a possible workaround for this type of issue, but i would love to see if there is a way for wagmi team to patch it so we do not need to introduce workarounds in our codebase, see discussion here
Link to Minimal Reproducible Example
No response
Steps To Reproduce
@tanstack/react-query
to version5.59.0
BigInt
value to the eitheruseReadContract
oruseReadContracts
What Wagmi package(s) are you using?
wagmi
Wagmi Package(s) Version(s)
2.12.17
Viem Version
2.21.16
TypeScript Version
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: