mutation taking a long time to appear after prefetching query
Hello,
I'm am currently having an issue where if my
isCaptchaValid
endpoint errors (using throw new TRPCError(...)
) the error message takes a long time to come through, it appears that it is linked to the endpoints execution time, as if I add some code to wait 2 seconds before executing it dramatically increases the time it takes for the error to come back.
I am using nextjs loading.tsx which is how the loading animation works, so as soon as the loading animation is gone it means that TRPC data has finished fetching, so the error message should be appearing instantly?
In the below server component you can see I am using prefetch
and in the client component you can see I am using useQuery
, which should not be refetching on first render since I used prefetch function.
Server component:
client component:
1 Reply
im just so confused, because the query knows it errored, but
<hydrateclient>
isn't passing the error object down to the client
A demonstration of the issue:
https://gyazo.com/610a1e2d835445e70fd2400812cad7c9Gyazo
Gyazo Screen Video