-
-
Couldn't load subscription status.
- Fork 3.5k
Closed as not planned
Closed as not planned
Copy link
Labels
Description
Describe the bug
const enabled = ref(false);
const { data, suspense } = useInfiniteQuery({ enabled })
await suspense()Your minimal, reproducible example
https://codesandbox.io/p/devbox/eloquent-frog-3w6pk9?file=%2Fapp.vue
Steps to reproduce
- By default the preview will never end loading
- Change the line in
/app.vue
-const enabled = ref(false);
+const enabled = ref(true);- Refresh preview
Expected behavior
Instantly exit suspense() as there's nothing to fetch while ssr.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
nuxt^3.5.2
Windows 11
Chrome 126
Tanstack Query adapter
vue-query
TanStack Query version
5.45.0
TypeScript version
No response
Additional context
This only reproducible when using useInfiniteQuery(), useQuery() is not affected:
-const { data, suspense } = useInfiniteQuery({
+const { data, suspense } = useQuery({
queryKey: ['test'],
queryFn: fetcher,
- initialPageParam: '',
- getNextPageParam: () => '',
enabled
})