You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I checked there isn't already an issue for the bug I encountered.
Describe the bug
When attempting to debug wagmi queries with the TanStack devtools, the devtools fails to open if I use both useQuery and useReadContract in the same component, if the contract being read with useReadContract has bigint values as arguments into the function call. In the JavaScript console it throws an error of:
Uncaught (in promise) TypeError: Do not know how to serialize a BigInt
at JSON.stringify (<anonymous>)
at hashKey (chunk-6Y4SHYZR.js?v=c0e65ea7:123:15)
at hashQueryKeyByOptions (chunk-6Y4SHYZR.js?v=c0e65ea7:120:10)
at matchQuery (chunk-6Y4SHYZR.js?v=c0e65ea7:69:31)
at chunk-6Y4SHYZR.js?v=c0e65ea7:1098:18
at Array.find (<anonymous>)
If the component uses only useQuery or useReadContract, the issue doesn't happen. Only if they're both used. and if the useReadContract target function doesn't take a bigint value as input, it doesn't happen.
Install wagmi v2, with @tanstack/react-query-devtools v5.66.
In one component, use both useQuery (imported from @tanstack/react-query) and useReadContract (imported from wagmi). Note the page renders just fine; both queries succeed.
Attempt to open the react-query-devtools view. It fails and in the Javascript console gives an error
What Wagmi package(s) are you using?
wagmi
Wagmi Package(s) Version(s)
2.14.1
Viem Version
2.7.9
TypeScript Version
5.0.4
Anything else?
This was originally experienced as #3328, under wagmi v1. After upgrading to v2, the issue persists, and I've narrowed it down to just this situation of combining two different types of react-query calls.
The text was updated successfully, but these errors were encountered:
Check existing issues
Describe the bug
When attempting to debug
wagmi
queries with the TanStack devtools, the devtools fails to open if I use bothuseQuery
anduseReadContract
in the same component, if the contract being read withuseReadContract
has bigint values as arguments into the function call. In the JavaScript console it throws an error of:If the component uses only
useQuery
oruseReadContract
, the issue doesn't happen. Only if they're both used. and if theuseReadContract
target function doesn't take a bigint value as input, it doesn't happen.Link to Minimal Reproducible Example
https://stackblitz.com/edit/new-wagmi-qqhzxm
Steps To Reproduce
wagmi
v2, with@tanstack/react-query-devtools
v5.66.useQuery
(imported from@tanstack/react-query
) anduseReadContract
(imported fromwagmi
). Note the page renders just fine; both queries succeed.react-query-devtools
view. It fails and in the Javascript console gives an errorWhat Wagmi package(s) are you using?
wagmi
Wagmi Package(s) Version(s)
2.14.1
Viem Version
2.7.9
TypeScript Version
5.0.4
Anything else?
This was originally experienced as #3328, under wagmi v1. After upgrading to v2, the issue persists, and I've narrowed it down to just this situation of combining two different types of react-query calls.
The text was updated successfully, but these errors were encountered: