Next.js · sdk · fg-0301

File upload through a Server Action fails with 'Body exceeded 1 MB limit'

Error: Body exceeded 1 MB limit.

Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100

Cause

Server Actions cap the request body at 1 MB by default to limit parsing cost and abuse. FormData with a file counts toward that cap.

Fix

Raise serverActions.bodySizeLimit to what you actually need, or upload large files straight to object storage with a presigned URL and send only the key to the action.

Apply

// next.config.ts
export default {
  experimental: { serverActions: { bodySizeLimit: '10mb' } },
}

Affects: Next.js 14 to 16.4, App Router Server Actions

Sources

Have your agent know this before it fails

claude mcp add --transport http footgun https://getfootgun.com/api/mcp