Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
BierDav opened this issue Jun 6, 2024 · 5 comments
Open
Labels
bug Something isn't working help wanted Extra attention is needed package: query-devtools

Comments

@BierDav
Copy link
Contributor

BierDav commented Jun 6, 2024

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 BierDav changed the title Cannot read properties of null (reading '__previousQueryOptions') Bug:Cannot read properties of null (reading '__previousQueryOptions') Jun 6, 2024
@BierDav BierDav changed the title Bug:Cannot read properties of null (reading '__previousQueryOptions') Bug: Cannot read properties of null (reading '__previousQueryOptions') Jun 6, 2024
@TkDodo
Copy link
Collaborator

TkDodo commented Jun 7, 2024

please show a minimal sandbox reproduction, thank you

@lancedw
Copy link

lancedw commented Jun 11, 2024

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

@ruiaraujo012
Copy link

I'm experiencing this as well

@BierDav
Copy link
Contributor Author

BierDav commented Jun 16, 2024

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

@TkDodo
Copy link
Collaborator

TkDodo commented Sep 13, 2024

I think #8054 is related and has a reproduction:

If someone wants to work on a fix, please do

@TkDodo TkDodo added help wanted Extra attention is needed and removed needs-info labels Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed package: query-devtools
Projects
None yet
Development

No branches or pull requests

4 participants