Vercel Functions Now Take 20MiB Request Bodies, but Read the Middleware Catch First

On 20 November, Vercel raised the request body limit on Vercel Functions from 4.5MB to 20MiB, in public beta. Anyone who has built an upload form on Vercel has met the old limit, usually when a client tries to send a phone photo and gets a 413 error.
It is worth switching on, but it has conditions, and one of them can break a site.
You opt in per project and per environment by setting VERCEL_SUPPORT_LARGE_REQUEST_BODY=1. The project's functions must use the performance memory setting of 4GB. It applies to the Node.js, Python and Bun runtimes. Anything on the Edge runtime keeps the 4.5MB cap.
The catch is middleware. Once a project opts in, Routing Middleware receives the headers and metadata of each request but no body. Vercel does this to avoid sending the body twice. If your middleware reads the body, for example to verify a webhook signature or inspect a form post, that logic will stop working. Move it into the function itself before you flip the switch.
Our approach: enable it on preview first, which the per-environment setting allows, and test every form and webhook. For anything larger than a few megabytes, such as video or print files, we would still upload straight from the browser to storage. A 20MiB limit is a comfortable margin for images and documents. It is not a file transfer service.