Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increase execution limit for Server Action in NextJS / Vercel?

I have a Server Action in NextJS14 hosted on Vercel. In the Vercel logs I can see the function is timing out:

Execution Duration / Limit.    15.01s / 15s (timed out)

I'm calling the OpenAI API which can be slow. How do I increase the time limit?

like image 600
Evanss Avatar asked Dec 28 '25 21:12

Evanss


1 Answers

You must apply a new max duration inside your top level page.tsx:

export const maxDuration = 90;

export async function Page(){ }

Inside route-segment in next-js docs you can find more information about it.

like image 66
Melo Avatar answered Jan 03 '26 10:01

Melo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!