Increasing Body 1mb limit

Hey, Im trying to build an application that allows sending of base64 encoded files to my next.js server through TRPC. I read online that the only currently supported way to do that is by base64 encoding and then shipping it over through JSON. Is there a way to increase the default 1mb limit on post requests? For my purposes 2-4MB would be more than enough But i am expecting a few at > 1mb filesize.
N
Nick328d ago
That limit will likely be from whatever web server is hosting your tRPC api This isn’t really the best way to send files around though, you can end up essentially DDOS’ing yourself Right now the best production ready way is to use a file host and have the frontend upload or download from that, the API just generates secure links We do have an experimental Form Data implementation but it’s going to change a lot
K
karatemanjohnson328d ago
gotcha, so if i'm using next/js the issue is somewhere withing my next/js config, not TRPC this also isnt for production more for a hackathon style project. Its not going to be hosted. I just have a few files over 1mb that I'd like to be able to upload
N
Nick328d ago
GitHub
trpc/examples/.experimental/next-formdata at main · trpc/trpc
🧙‍♀️ Move Fast and Break Nothing. End-to-end typesafe APIs made easy. - trpc/examples/.experimental/next-formdata at main · trpc/trpc
N
Nick328d ago
This might help, though it’s not any more documented than that right now
More Posts
Nitro and tRPC in vercel-edgeHey there! I hope this is the right place to ask for help. I am trying to deploy an application witHow to retrieve and receive Bigint data to/from TRPC procedureNode: `v16.15.1` I'm trying to return an object which contains an `amount` property from one of my TypeError: Cannot read properties of null (reading 'useContext') when using useMutation with TRPC inI'm encountering an error in my Next.js application when trying to use the useMutation hook with TRPInitial websockets getToken() returns null: next-auth + websockets :)Hello! So the way I am trying to authenticate websockets is like this: ``` import { getToken } froCan I get the original type name, instead of the shape, with query?I'm not sure how to explain it, so, here's a screen shot:TRPCClientError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON ErrorHello folks, I'm getting an issue with my integration, I'm a newbie in tRPC and I can't work well mytrpc corsmy sveltekit app is running on https://example.com with tRPC and it's making requests to http://127.T3 app tRPC external callsCurrently i'm just making Post request and formatting my payload to ```{ "0": { "json":Next-auth session not being fetched in tRPC contextNext-auth session not being fetched in tRPC contextuseMutation not handeling arguments correctly.Hello, I have a mutation setup on the server with the input being an object containing the fields emUpdate Clerk Organization from TRPC Router (T3 Stack)Hello, if anyone got an idea on how to handle this I would highly appreciate it. I have some organiHow to not send request in specific condition in useQuery()```js const { data: artists, isLoading } = api.findArtist.useQuery({ name: search, }); ``` TRPCClientError: fetch failedI get the below error when createTRPCProxyClient runs on BE of a Next.JS app hosted on Vercel: ```TinferRouterOutputs not inferringCould anyone point me in the right direction to why my types aren't being inferred here? (Using T3 bModular Router ThoughtsHello, I hope I can convey clearly what I hope to accomplish. To start, I have a monorepo, with a feIssue with trpc fetch when trying to pass Clerk auth to contextI'm currently trying to add Clerk auth to my trpc context, but I just keep getting this error: `ErrBullMQ + TRPCCurious how to configure BullMQ with TRPC correctly. Currently I have the queue, queueevents, and thTrpc refetches all of the queries when i run a mutationIm running node 16.15.0 with Pnpm When i run a mutation for some reason all of the queries get refet