Sending FormData does not work at all
https://github.com/trpc/trpc/blob/main/examples/minimal-content-types I have this exact same setup with tRPC but does not work. Server just says "Input not instance of FormData", looking at the network tab it just sends a json payload
GitHub
trpc/examples/minimal-content-types at main ยท trpc/trpc
๐งโโ๏ธ Move Fast and Break Nothing. End-to-end typesafe APIs made easy. - trpc/trpc
Solution:Jump to solution
Got it working. Had to use
splitLink
with a condition for isNonJsonSerializable
11 Replies
Your setup must not be exactly the same then
What link setup are you using?
What does your code look like when submitting the data?
I've been looking at this issue: https://github.com/trpc/trpc/issues/1937#issuecomment-2557358137 and it's kind of solved the problem, looks like I needed to use a custom solution for the transformer
But now I just get errors:
Server:
Here's my packages:
Didn't know TRPC 11 is stable now
Yeah not working on
11.0.0
stableSolution
Got it working. Had to use
splitLink
with a condition for isNonJsonSerializable
Hey, would you mind posting your specific solution using
splitLink
? I am having a hard time implementing this. I wish the docs explained some of this now that this feature is released.Same here
Hi all, I'm working on updating the docs for this, but hopefully this fragment helps in the mean-time:
Works fine to me ๐ I will ask if we have an complete exmaple with octetInputParser ๐
Yes there is a minimal-content-types example in the repo
Unfortunately I seem to be getting an issue reproducing the same example in the repo
https://discord.com/channels/867764511159091230/1353965054235639850