[Server actions] Error: Body exceeded 1mb limit #49891
-
SummaryI am using server actions for file uploads. When trying to upload a file bigger than 1MB, the following error is being raised by the Next server: error Error: Body exceeded 1mb limit I tried the old way of exporting config, which seem to be deprecated. export const config = {
api: {
bodyParser: {
sizeLimit: '8mb',
},
},
} Is there a way I can increase the body size limit for server actions? Additional informationNo response ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
As of now I don't see any way to set body limit programmatically. For testing purposes you can change limit value in const actionData = await parseBody(req, "10mb") || ""; // Changed limit to 10mb |
Beta Was this translation helpful? Give feedback.
-
This feature has been blocked since You need to customize the The file is located in I've opened PR #51104 to resolve this hard-coded size issue. UPDATEResolved with #51104 Reference |
Beta Was this translation helpful? Give feedback.
-
on your next.config.js
From: https://nextjs.org/docs/app/api-reference/next-config-js/serverActions |
Beta Was this translation helpful? Give feedback.
@kasipavankumar
serverActiionsBodySizeLimit
has been added on release v13.4.8.