maxDuration and server actions #58855
Replies: 6 comments 14 replies
-
You set it on the route segment that executes the action, i.e. the layout or page that does not have a |
Beta Was this translation helpful? Give feedback.
-
I also was looking an explicit sentence in the docs but couldn't see anything. So, I wanted to add the maxDuration at the most top level in my root page.tsx as @tillka did. Also, I upgraded my free plan to pro. Now, it works as I desired. Version: Nextjs v14.1.0 with App Router. |
Beta Was this translation helpful? Give feedback.
-
I am using server action to call an api which takes upto 25s to response and db operations are perform in the backend. I am on the pro plan which support 60s for the API routes. how to resolve this issue |
Beta Was this translation helpful? Give feedback.
-
This issue seems to have opened up with the Hobby plan now: https://github.com/orgs/vercel/discussions/7094#discussion-6781027 |
Beta Was this translation helpful? Give feedback.
-
How can I increase the timeout for vercel server actions |
Beta Was this translation helpful? Give feedback.
-
I tried everything, and only one thing worked for me. Note: I'm on React 19 and NextJS 15. Adding this to my page component from where the server action is called fixed it: export const maxDuration = 300; What didn't work:
Overall, I'm disappointed in the state of the documentation from Vercel on server actions. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I am trying to migrate some API routes towards Server Actions, but I am stuck with
maxDuration
: how can we set it for the POST endpoints generated by server actions?Beta Was this translation helpful? Give feedback.
All reactions