useInfiniteQuery throws Cannot read properties of undefined (reading 'length') #7455
Replies: 3 comments 6 replies
-
Don't know the cause, but changing queryKey solved the problem |
Beta Was this translation helpful? Give feedback.
-
After upgrading from version 4 to version 5, we also began encountering this issue. We checked our query key, which is used only once in the useInfiniteQuery method, but it is used more than once during manual cache updates using the setQueryData method. |
Beta Was this translation helpful? Give feedback.
-
i have alsomist the same issue right now as wel i hope i can et a solution this is my rsc warpping the cclient component import { fetchAllProducts } from "@/actions"; // Define the expected parameter types export default async function Page({
} and this is my client comonent "use client"; import { fetchAllProducts, IProduct } from "@/actions"; const PRODUCTS_PER_PAGE = 12; interface ProductGridProps { interface ProductsPage { export default function GridContainer({ order }: ProductGridProps) {
} and this is the function ttself thats being called export async function fetchAllProducts(
} everything works fine , i get the necessary data , except that i keep getting this eroor , i have treid to handle all undeifned properties and null checks , but still the same issue, i hoe i can get some help |
Beta Was this translation helpful? Give feedback.
-
Hi. I have this code:
But an error is thrown in React-query's internal method, and getNextPageParam I passed as a prop doesn't seem to be called.
I don't see any errors in my code. I'll appreciate any help, thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions