query icon indicating copy to clipboard operation
query copied to clipboard

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

Open BierDav opened this issue 1 year ago • 5 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

BierDav avatar Jun 06 '24 06:06 BierDav

please show a minimal sandbox reproduction, thank you

TkDodo avatar Jun 07 '24 20:06 TkDodo

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

lancedw avatar Jun 11 '24 14:06 lancedw

I'm experiencing this as well

ruiaraujo012 avatar Jun 15 '24 19:06 ruiaraujo012

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

BierDav avatar Jun 16 '24 18:06 BierDav

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

TkDodo avatar Sep 13 '24 14:09 TkDodo

I'll work on this!

kaehehehe avatar Oct 28 '24 09:10 kaehehehe