Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Addressing "API Routes Response Size Limited to 4MB" Error in Next.js #55589

Open
lucajung opened this issue Sep 19, 2023 · 6 comments
Open
Labels
Documentation Related to Next.js' official documentation.

Comments

@lucajung
Copy link

What is the improvement or update you wish to see?

"Addressing "API Routes Response Size Limited to 4MB" Error in Next.js" does not seem to apply to App Router, although App Router has been selected.

Is there any context that might help us understand?

Is there another solution for the App Router? Then please add it to this document.

Does the docs page already exist? Please link to it.

https://nextjs.org/docs/messages/api-routes-response-size-limit

@lucajung lucajung added the Documentation Related to Next.js' official documentation. label Sep 19, 2023
@github-actions github-actions bot added the invalid link The issue was auto-closed due to a missing/invalid reproduction link. A new issue should be opened. label Sep 19, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Sep 19, 2023
@vercel vercel deleted a comment from github-actions bot Sep 19, 2023
@vercel vercel unlocked this conversation Sep 19, 2023
@balazsorban44 balazsorban44 reopened this Sep 19, 2023
@balazsorban44 balazsorban44 removed the invalid link The issue was auto-closed due to a missing/invalid reproduction link. A new issue should be opened. label Sep 19, 2023
balazsorban44 added a commit that referenced this issue Sep 19, 2023
kodiakhq bot pushed a commit that referenced this issue Sep 19, 2023
### What?

Continues #55525

Adding filtering for repro validation checks

### Why?

#55589 should not have been closed

### How?

balazsorban44/nissuer@ecbf8b4
@lucajung lucajung changed the title Docs: Docs: Addressing "API Routes Response Size Limited to 4MB" Error in Next.js Sep 19, 2023
@ozd3v
Copy link

ozd3v commented Oct 12, 2023

what is the solution or workaround for app router ?

@adilapapaya
Copy link

Bumping this up as there still doesn't seem to be a solution even though app router is the new standard.

When I try to build with this in my route.js file,

export const config = {
  api: {
    responseLimit: '5mb',
  },
}

I get this error:

Error: Page config in /next-example/src/app/api/load/route.js is deprecated. Replace `export const config=…` with the following:
Visit https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config for more information.

However, https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config doesn't any any options for setting the api response limit.

What is the solution / workaround for app router?

@dacxjo

This comment has been minimized.

@dacxjo
Copy link

dacxjo commented Mar 4, 2024

Seems that in app router you have to do:

const nextConfig = {
  experimental: {
    serverActions: {
      bodySizeLimit: '15mb'
    }
  }
}

in the next.config.js file

@ozd3v
Copy link

ozd3v commented Mar 21, 2024

is it solved???

@jurgen-siegel
Copy link

looking for a solution as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Related to Next.js' official documentation.
Projects
None yet
Development

No branches or pull requests

6 participants