tRPCttRPC
Powered by
peternovakP
tRPC•3y ago•
1 reply
peternovak

How to set sizeLimit > 1MB (to solve 413 error)?

Hi all,

I am trying out the T3 stack where I want to send area polygons given by the user to my NextJs backend using TRPC. It worked well for smaller polygons drawn by hand, but one I allowed my users to upload files over 1MB I run into the problem of '413 (Body exceeded 1mb limit)'

I found in the NextJs documentation:
https://nextjs.org/docs/pages/building-your-application/routing/api-routes#custom-config
that the setting to enable this is to reconfigure this limit to something like:

sizeLimit: '4mb',

In a suitable place. I have tried to add this configuration into various places of my trpc.ts but so far without success. Does anyone have any advice of how to reconfigure this limit properly?

Greateful for all advises!
image.png
Routing: API Routes
Next.js supports API Routes, which allow you to build your API without leaving your Next.js app. Learn how it works here.
Routing: API Routes
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

how to solve this
manumanagerMmanumanager / ❓-help
2y ago
Increasing Body 1mb limit
karatemanjohnsonKkaratemanjohnson / ❓-help
3y ago
Error: No QueryClient set, use QueryClientProvider to set one
welpWwelp / ❓-help
3y ago