App router body size limit per route #68409
Unanswered
Cajuteq
asked this question in
App Router
Replies: 1 comment
-
Related to this, I'd like also like to be able to set custom limits per server action. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Non-Goals
Background
Two issues were already raised on this topic, but both went stale so I think a discussion might suits the topic better. See
#52457
#57501
In page router there was a configuration per page looking like :
https://nextjs.org/docs/pages/building-your-application/routing/api-routes#custom-config
In App router, since #49891 there is a global
experimental.serverActions.bodySizeLimit
https://nextjs.org/docs/app/api-reference/next-config-js/serverActions
During convertion to App Router, keeping the old option triggers an error with a link to https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config which list the current options. One can recognize maxDuration which is present in both the old and the new config.
Proposal
I think the linked page should at least provide a link or a hint to the new global (experimental) option (which we found difficult to find)
We only used to override the sizeLimit on specific route who are dealing with files. We no longer have this possibility are now constrained to allow it globaly. I think we should keep the new global parameter but also reintroduce the per Route override option similar to how maxDuration now has both.
The documentation could then be updated in a way similar to maxDuration
https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#maxduration
which provide a "Good to know" section with a link to the global parameter.
Beta Was this translation helpful? Give feedback.
All reactions