queryCache.findAll() returns wrapped iterable instead of array — breaks standard invalidation APIs
#10257
Unanswered
nicolas-chalet-wmx
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Environment:
@tanstack/react-queryv5.90.2Description:
We're building a library that uses react-query and is consumed by a host application. In certain build configurations (mobile WebViews), we observe unexpected behavior:
We suspect this is due to module duplication where our library and the host app resolve to different instances of
@tanstack/react-query.Impact:
Due to this issue, we cannot use the standard react-query APIs for cache management:
This forces us to bypass the intended API and work directly with
Queryinstances, which feels brittle and may break with future versions.Questions:
Query.invalidate()/Query.reset()/Query.fetch()a supported pattern, or are we relying on internal implementation details?Workaround:
We currently normalize the result by checking if the first element is iterable:
Beta Was this translation helpful? Give feedback.
All reactions