mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #338] [MERGED] feat: support experimental.serverActions.bodySizeLimit from next.config #490
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#490
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/338
Author: @youanden
Created: 3/8/2026
Status: ✅ Merged
Merged: 3/8/2026
Merged by: @james-elicx
Base:
main← Head:feat/body-size-limit📝 Commits (3)
88de1c3feat: support experimental.serverActions.bodySizeLimit from next.config226f033fix: address PR review feedback for parseBodySizeLimit48e5ab9fix: warn on invalid bodySizeLimit string instead of silently falling back📊 Changes
4 files changed (+158 additions, -5 deletions)
View changed files
📝
packages/vinext/src/config/next-config.ts(+43 -1)📝
packages/vinext/src/index.ts(+1 -0)📝
packages/vinext/src/server/app-dev-server.ts(+7 -3)📝
tests/next-config.test.ts(+107 -1)📄 Description
Adds support for reading experimental.serverActions.bodySizeLimit from next.config.ts and using it to configure the server action request body size limit. Currently, vinext hardcodes
__MAX_ACTION_BODY_SIZEto 1MB (1 * 1024 * 1024), ignoring any user configuration and causing 413 Payload Too Large errors when uploading files >1MB via server actions.Next.js respects this setting (docs), but vinext's generated dev server entry hardcodes the limit.
Problem
I faced an issue uploading files above 1MB in dev mode that drove this PR's creation. I had created a patch in my repo beforehand to correct the problem locally:
Test plan
Added 14 unit tests covering string parsing (mb/kb/gb/b), numeric passthrough, case insensitivity, fractional values, and default/invalid fallbacks
Added integration tests verifying
resolveNextConfig()end-to-end withexperimental.serverActions.bodySizeLimitAll existing tests continue to pass, oxlint was clean, typecheck had 4 existing errors prior to my changes.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.