Trpc mutate is only triggered, no return (Base64 string with length equal to 14079152 as input)

Do you have any idea what may cause this? I'm converting videos to audio and then base64 string and I would like to send them to our trpc router. It's working fine for shorter videos (smaller string) but longer videos only trigger mutation. It's not even printing the console.log right at the start of the mutation.
9 Replies
oskar9096
oskar90962y ago
ok, I have an update
oskar9096
oskar90962y ago
so it seems that when body is way bigger than 1mb the trpc is not showing an alert
Finn
Finn2y ago
converting videos to audio and then base64 string and I would like to send them to our trpc router
converting videos to audio and then base64 string and I would like to send them to our trpc router
why
Endgame1013
Endgame10132y ago
I’m pretty sure you’re gonna be running into issues in prod if you’re passing that much data along in the request/response body.
oskar9096
oskar90962y ago
I can't send formData as trpc cannot handle this content type. Generally, I need audio from the video to create transcription with Whisper which is called from BE. I'm converting video to audio on the client side so I won't have to upload the whole video, get the URL, download it again on the BE and then extract audio.
Finn
Finn2y ago
Just use a normal req Res handler and not trpc
oskar9096
oskar90962y ago
yeah I know but I was wondering if there is a correct way to handle this with trpc
Finn
Finn2y ago
the way is to not
Endgame1013
Endgame10132y ago
To my knowledge, tRPC really isn’t built for file uploads/downloads, as it is all built around JSON req/res. The recommended pattern is to use something like S3 pre-signed URLs where you can, but it sounds like your application is centered around converting files. In my opinion, you may want to just use a traditional REST API for this.
Want results from more Discord servers?
Add your server