T
TanStack2w ago
extended-salmon

useQuery keeping the whole page in loading state

Hey guys. This might seem a bit weird but I'm using start with solid and whenever i use a simple query and it resolves and the loading state becomes false, it still keeps the tab in a loading state even thought everything works
const modeAlertsQuery = useQuery(() => ({
queryKey: ['alerts', 1],
queryFn: () => {
console.log('Fetching operating mode alerts...')
return 10
},
}))
return null
const modeAlertsQuery = useQuery(() => ({
queryKey: ['alerts', 1],
queryFn: () => {
console.log('Fetching operating mode alerts...')
return 10
},
}))
return null
even this with no loaders and just the simples setup causes the tab to be kept in a loading state. any idea what could be the issue?
5 Replies
stormy-gold
stormy-gold2w ago
Do you have a suspense boundary around where you use the query?
extended-salmon
extended-salmonOP2w ago
well, i have one in the root route but thats pretty much it, doesnt seem to get triggered though
stormy-gold
stormy-gold2w ago
Can you also make sure you've upgraded to the latest versions. We did some updates not too long ago
extended-salmon
extended-salmonOP2w ago
Yep, will do! also found that I have two query clients with two providers, that might be clashing together causing the issue. removed one but not im getting this error
Error: Cannot read properties of undefined (reading 'defaultQueryOptions')
Error: Cannot read properties of undefined (reading 'defaultQueryOptions')
trying to investigate that rn was mostly an issue with the version of solid query. updating it resolved the issue
stormy-gold
stormy-gold2w ago
Nice

Did you find this page helpful?