How can we enable experimental TRCP features?

I'm using the app router, and i'm getting type errors when trying to enable experimental TRCP features, specifically, i'm trying to enable streaming responses: https://www-git-05-01-stream-trpc.vercel.app/docs/client/links/httpBatchStreamLink#generators But adding it to the initTRCP function gives me a type error:
const t = initTRPC.context<typeof createTRPCContext>().create({
experimental: {
iterablesAndDeferreds: true,
},
transformer: superjson,
errorFormatter({ shape, error }) {
return {
...shape,
data: {
...shape.data,
zodError:
error.cause instanceof ZodError ? error.cause.flatten() : null,
},
};
},
});
const t = initTRPC.context<typeof createTRPCContext>().create({
experimental: {
iterablesAndDeferreds: true,
},
transformer: superjson,
errorFormatter({ shape, error }) {
return {
...shape,
data: {
...shape.data,
zodError:
error.cause instanceof ZodError ? error.cause.flatten() : null,
},
};
},
});
I've tried updating the TRCP packages, but that seems to not work. Has anyone had any luck with this?
HTTP Batch Stream Link | tRPC
unstable_httpBatchStreamLink is a terminating link that batches an array of individual tRPC operations into a single HTTP request that's sent to a single tRPC procedure (equivalent to httpBatchLink), but doesn't wait for all the responses of the batch to be ready and streams the responses as soon as any data is available.
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server