Skip to content

How fix "Error: Body exceeded 1mb limit" when i uses api actions? #51097

Discussion options

You must be logged in to vote

Increase the response size limit by using a custom config in your API file.

export const config = {
  api: {
    responseLimit: false | '8mb' | YOUR_DESIRED_SIZE_LIMIT,
  },
}

UPDATE

This feature has been blocked since App Router. It is currently hard-coded to 1mb as you can see here.

You need to customize the parseBody() size manually through node_modules.. not recommended but no "quicker" option is available at this moment.

The file is located in node_modules\next\dist\server\app-render\action-handler.js.

UPDATE2

Resolved with #51104

Reference

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@baldTooth
Comment options

@devjiwonchoi
Comment options

Answer selected by baldTooth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants