Next.js Discord

Discord Forum

Max payload size trpc?

Unanswered
Pacific sand lance posted this in #help-forum
Open in Discord
Pacific sand lanceOP
Does anyone know how to increase max payload size for trpc with nextjs14 and app router. I have tried all the methods I could find. I cannot increase it.

9 Replies

Pacific sand lanceOP
Doesn't work. Have already tried this method.
@@ts-ignore https://nextjs.org/docs/messages/api-routes-response-size-limit
West African Lion
these are http apis being described
depending on where you are hosting this, the reverse proxy buffer can fuck with the payload size
nginx for example needs a higher proxy_buffer_size of atleast 256k for what ur trying
@Pacific sand lance Does anyone know how to increase max payload size for trpc with nextjs14 and app router. I have tried all the methods I could find. I cannot increase it.
West African Lion
try adding to next.config.js or next.config.mjs

10mb can be whatever u want obv
module.exports = {
    serverActions: {
        bodySizeLimit: '10mb'
    }
}
if you are proxying with NGINX then you should also update the config file located at
/etc/nginx/nginx.conf

http {
  sendfile on;
  tcp_nopush on;
  types_hash_max_size 2048;
  client_max_body_size 10M;
}
@West African Lion try adding to `next.config.js` or `next.config.mjs` 10mb can be whatever u want obv ts module.exports = { serverActions: { bodySizeLimit: '10mb' } }
Pacific sand lanceOP
I'm hosting on vercel. Thanks for the advice but it doesn't work. I've tried fucking everything with regards to this.