Infinite loop with Hydration Boundary and Next.js 14 App Router
Hey, I'm trying some prefetching with app router but I've got infinite loop error like on the screen. Here is code:
When I comment out
prefetchQuery part, everything works fine. It seems like HydrationBoundary have some problem with hydrating data. Here are my console.logs:
I was following documentation and I don't see obvious error, can someone help me? OrganizationUsersTable is empty component with "use client". I have other client query in the application and it works fine so I assume it's not the problem with my setup or something related to queryClient. OrganizationUsers component is of course page.tsx file in my directory structure.
2 Replies
mute-goldOP•2y ago
I think I found an answer:
queryFn: () => getOrganizationMembersRequest(1, requestCookie) returns whole axios response. When I return just response.data it suddenly works, but I don't know why. Anyone has answer?sensitive-blue•2y ago
probably something inside the axios response is circular and next can't serialize this