Bug: Cannot read properties of null (reading '__previousQueryOptions')
Describe the bug
When you press "Restore Loading" in Dev tools, when the query is currently really fetching you get following error:
TypeError: Cannot read properties of null (reading '__previousQueryOptions')
at restoreQueryAfterLoadingOrError (U2TDTBMY.js:10728:60)
at _el$85.$$click (U2TDTBMY.js:10778:11)
at HTMLDocument.eventHandler (dev.js:868:66)
Steps to reproduce
- create a Query that is taking very long so that you have time to press "Restore Loading" in Dev tools, when it is currently evaluating
Expected behavior
Either disable this button or deal with the field beeing null.
How often does this bug happen?
Always
Screenshots or Videos
Platform
- OS: Windows
- Browser: Chrome
- Node: v21.7.3
Tanstack Query adapter
solid-query
TanStack Query version
5.40.0
TypeScript version
No response
Additional context
No response
please show a minimal sandbox reproduction, thank you
Experiencing the same issues on v5.40.1, looks like it has something to do with the query not being resolved (error state)
I'm experiencing this as well
please show a minimal sandbox reproduction, thank you
const query = createQuery(()=>({queryFn: ()=> new Promise((resolve)=> setTimeout(resolve,10000))}))
Now open the dev tools and press restore loading when the query hasn't fininshed yet
I think #8054 is related and has a reproduction:
- https://codesandbox.io/p/devbox/ancient-framework-lt77x8
If someone wants to work on a fix, please do
I'll work on this!