Skip to content
Source
Sign inSign up
TanStack/query

Bug: Cannot read properties of null (reading '__previousQueryOptions') #7521

Send to my agent
ClosedBierDav(GitHub profile, opens in a new tab) opened this issue 6 comments

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

  1. 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

image

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

  1. BierDav(GitHub profile, opens in a new tab) changed the title

  2. BierDav(GitHub profile, opens in a new tab) changed the title

  3. please show a minimal sandbox reproduction, thank you

  4. TkDodo added labelsbug

  5. TkDodo added labelsneeds-info

  6. TkDodo added labelspackage: query-devtools

  7. Experiencing the same issues on v5.40.1, looks like it has something to do with the query not being resolved (error state)

  8. 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

  9. I think #8054 is related and has a reproduction:

    If someone wants to work on a fix, please do

  10. TkDodo removed labelsneeds-info

  11. TkDodo added labelshelp wanted

  12. TkDodo closed this

Sign in to join this conversation.