Skip to content
Discussion options

You must be logged in to vote

The root cause here is that your ServerFetchBoundary isn't awaiting the prefetches, which triggers the streaming path that's broken for infinite queries (the bug TkDodo linked).

Here's what happens step by step:

  1. infiniteQueries.forEach(opt => queryClient.prefetchInfiniteQuery(opt)) fires the prefetch but doesn't await it, so the query stays in pending state when dehydrate(queryClient) runs
  2. Because you have || query.state.status === 'pending' in shouldDehydrateQuery, the pending promise gets dehydrated and sent to the client
  3. On the client, hydration calls query.fetch(undefined, { initialPromise }) to pick up the stream — but critically, it does not attach infiniteQueryBehavior because hyd…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Hina0222
Comment options

Answer selected by Hina0222
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants