Short answer
For forms that are only a little over 1 MB, raise serverActions.bodySizeLimit in next.config.js and leave some room for the upload overhead. For real files, such as photos or PDFs, upload from the browser straight to storage and send only the file’s address to the Server Action. On Vercel, a function can’t take a body over 4.5 MB whatever the setting.
Why the Server Action fails, and the fix
01
The request is over the default 1 MB
“By default, the maximum size of the request body sent to a Server Action is 1MB” Next.js, serverActions
Server Actions accept 1 MB by default, and a photo from a phone is often larger. Next.js lets you raise the limit in next.config.js.
/** @type {import('next').NextConfig} */ module.exports = { experimental: { serverActions: { bodySizeLimit: '2mb', }, }, }02
The limit is raised, but uploads near it still fail
“If you expect uploads close to the configured value, leave some room for this overhead.” Next.js, serverActions
Form uploads add boundaries and headers to the body, so a file just under the limit can still go over it. Set the limit with some room to spare.
03
The app runs on Vercel and the file is bigger than 4.5 MB
“The maximum payload size for the request body or the response body of a Vercel Function is 4.5 MB.” Vercel, Functions limits
Raising bodySizeLimit doesn’t lift Vercel’s own cap on a function’s request body. Upload big files from the browser straight to storage, such as Vercel Blob client uploads or a signed upload URL, and pass only the file’s address to the Server Action.
Checked against the vendor’s docs on : Next.js docs: serverActions; Vercel docs: Functions limits.
Rather hand it over?
Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.
- from $450App Fix TicketOne reproducible bug in an existing mobile or web app, diagnosed and fixed.See scope and start
- from $450AI-Built App RescueA Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way.See scope and start
Related: Vercel 413 payload too large · Next.js image hostname not configured · Next.js DynamicServerError · Next.js hydration error