-
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 |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments
-
what is the solution or workaround for app router ? |
Beta Was this translation helpful? Give feedback.
-
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 export const config = {
api: {
responseLimit: '5mb',
},
} I get this error:
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? |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
Seems that in app router you have to do: const nextConfig = {
experimental: {
serverActions: {
bodySizeLimit: '15mb'
}
}
} in the next.config.js file |
Beta Was this translation helpful? Give feedback.
-
is it solved??? |
Beta Was this translation helpful? Give feedback.
-
looking for a solution as well |
Beta Was this translation helpful? Give feedback.
-
just use |
Beta Was this translation helpful? Give feedback.
-
@lucajung A response size limit does not apply to Route Handlers because the response is streamed, unlike API Routes. We should clarify this in the documentation 👀 |
Beta Was this translation helpful? Give feedback.
@lucajung A response size limit does not apply to Route Handlers because the response is streamed, unlike API Routes.
We should clarify this in the documentation 👀