tRPCttRPC
Powered by
CattpotC
tRPC•13mo ago•
5 replies
Cattpot

unstable_httpBatchStreamLink and formData -> not compatible

Hy, i am using unstable_httpBatchStreamLink to use the async generators and it is working very well. But if I use this Link i cannot upload any File with Formdata.
if im using the normal httpLink I can upload the files with Formdata but not use the async generators. The input Validation uses zod-form-data "zfd.formData({ file: zfd.file() })" like in the documentation.. pls help me, maybe I am using the links in a bad way?
Using V11
Solution
links: [
splitLink({
condition: (op) => op.path=== 'MyPathFromFormData',
true: unstable_httpSubscriptionLink({
url,
transformer,
}),
false: httpBatchLink({
url,
transformer,
}),
}),
],
Jump to solution
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Error handling abort on unstable_httpBatchStreamLink
Cybermuse.ioCCybermuse.io / ❓-help
16mo ago
trpc 11 superjson transformer not working with unstable_httpBatchStreamLink
NeatZNNeatZ / ❓-help
13mo ago
Why use unstable_httpBatchStreamLink in React server components?
BeBoREBBeBoRE / ❓-help
3y ago
TextDecoder not implemented Trpc react-native httpBatchStreamLink
2035Builder22035Builder / ❓-help
2y ago