w7tf
Has anyone got Tanstack Start with tRPC working?
I have used the example project in /examples on tRPC Github. Unfortunately when I try to fetch the posts I receive the following error:
Error in renderToPipeableStream: TRPCClientError: Invalid response or stream interrupted
Replacing unstable_httpBatchStreamLink with httpBatchLink did not help.
2 replies
Is it possible to use tRPC React Query Integration without defining a trpc provider?
When using react query without tRPC the query client can be passed as an argument when using the hook. Example:
const { data: inquiries } = useQuery(
{
initialData: data,
queryKey: ["data"],
queryFn: async () => await fn(),
},
queryClient,
);
Now my question would be if it is possible to pass the trpcClient in a similar manner to a tRPC wrapped useQuery / useMutation hook.
For those wondering why: Astro's island architecture breaks the ability to use providers. It would be possible to wrap each island with a provider but passing the client would make it much easier.
2 replies