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
After making a request to a Rest API endpoint that is missing, I receive a 404 status. I try to reset the loading state by pressing Trigger Loading in the Devtools to work on the loading state but I receive this error:
Cannot read properties of null (reading '__previousQueryOptions')
The code throwing the error is in Devtools.tsx and looks like this:
activeQueryVal.state.fetchMeta is null, I also notice that the .fetct(previousOptions) function is also missing in the activeQueryVal so it would crash there even if it could somehow get the previousOptions data. The Devtools work fine for other queries, and I notice nothing special in the way that the query is used, just that the other queries don't respond with 404.
I suspect the problem lies in the way I configured my axios client response interceptor.
Describe the bug
After making a request to a Rest API endpoint that is missing, I receive a 404 status. I try to reset the loading state by pressing
Trigger Loading
in the Devtools to work on the loading state but I receive this error:The code throwing the error is in
Devtools.tsx
and looks like this:activeQueryVal.state.fetchMeta
is null, I also notice that the.fetct(previousOptions)
function is also missing in theactiveQueryVal
so it would crash there even if it could somehow get thepreviousOptions
data. The Devtools work fine for other queries, and I notice nothing special in the way that the query is used, just that the other queries don't respond with 404.I suspect the problem lies in the way I configured my
axios
client response interceptor.Your minimal, reproducible example
https://codesandbox.io/p/devbox/ancient-framework-lt77x8
Steps to reproduce
OR use this https://codesandbox.io/p/devbox/ancient-framework-lt77x8
Expected behavior
I expect the query to go to loading again.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Tanstack Query adapter
react-query
TanStack Query version
v5.54.4
TypeScript version
Not using
Additional context
No response
The text was updated successfully, but these errors were encountered: