Skip to content
FIRERUN.

The BaaS & deploy-platform newsroom for builders

Subscribe

Vercel

Vercel Functions Accept 20MiB Bodies, but Middleware Can't Read Them

Opting in to 20MiB request bodies hides them from Routing Middleware and needs 4GB functions, so Hobby projects can't use it.

Abstract flat-vector editorial illustration for "Vercel Functions Accept 20MiB Bodies, but Middleware Can't Read Them"

Vercel Functions can now accept request bodies up to 20MiB, more than four times the 4.5MB cap that Vercel’s own guides told developers to route around. The limit is opt-in and in public beta, and turning it on changes how Routing Middleware works across the whole project (Vercel changelog, Nov. 20, 2026).

How to Turn It On

The larger limit is off by default. Vercel’s Functions limits page lists three requirements:

  • Fluid compute enabled on the project.
  • Function memory set to Performance (4GB), which the page says is available on Pro and Enterprise plans. Hobby tops out at 2GB, so Hobby projects can’t opt in.
  • The environment variable VERCEL_SUPPORT_LARGE_REQUEST_BODY=1, set per environment, followed by a redeploy.

Because the variable is scoped by environment, Vercel said a team can test it on Preview before enabling it in Production.

The beta covers the Node.js, Python and Bun runtimes. Functions on the Edge runtime keep the 4.5MB cap. Anything over the applicable limit still fails with a 413 FUNCTION_PAYLOAD_TOO_LARGE error. The response body limit stays at 4.5MB unless the response is streamed.

The Middleware Trade

Once a project opts in, Routing Middleware still runs and still sees headers and metadata, but it can no longer read request bodies. Vercel said the rule is enforced at the project level and that it avoids sending the same body to both Middleware and the target function, which would add cost and raise time to first byte.

Middleware that validates a JSON payload, checks a webhook signature against the raw body or rejects oversized uploads early will stop seeing the data it relies on, in every route, not only the ones that need big bodies. Vercel’s suggested exit for Edge code that needs the larger limit is to move it to the Node.js runtime with runtime: 'nodejs', or to use proxy.ts in Next.js.

Vercel also advised reading large bodies as soon as they arrive and processing them in chunks rather than holding them in memory.

What Changes for Uploads

Until now, Vercel’s answer to the cap was a workaround. Its knowledge base guide on bypassing the 4.5MB limit, last updated Nov. 10, 2025, tells developers to send files straight from the browser to Vercel Blob with client uploads, so the function only issues a token. That guide does not mention the new beta.

The Take

This is Firerun’s read, not Vercel’s.

Twenty mebibytes covers the uploads that kept tripping the old cap: phone photos, PDFs, small audio clips and chunky JSON from agents. For those, a team can now drop the token handshake and post the file to its own route.

It isn’t free, though. The opt-in requires the project’s function memory setting at 4GB, and Vercel bills provisioned memory by the amount allocated multiplied by run time, so a project that ran on the 2GB default will pay more for memory on every request, not just the large ones. Video and anything past 20MiB still belong in direct-to-storage uploads.

Audit middleware first. Search it for request.json(), request.text() and request.body. If any of them matter, either move that logic into the function or leave the flag off.

Key Takeaways

  • Vercel Functions accept request bodies up to 20MiB in public beta, up from 4.5MB.
  • It requires Fluid compute, 4GB Performance memory and VERCEL_SUPPORT_LARGE_REQUEST_BODY=1, which rules out Hobby.
  • Opting in blocks Routing Middleware from reading request bodies across the project.
  • Edge runtime functions keep the 4.5MB request cap, and responses stay at 4.5MB unless streamed.

Stay in the loop

Get new articles in your inbox

We'll only email you when a new article drops. Unsubscribe anytime.