I've encountered an issue with my API endpoint on a NextJS project where it exceeds the 60-second time limit to execute. Despite being on a pro Vercel plan, I have been unable to extend the timeout limit successfully.
Within the endpoint itself, I attempted to modify the settings using:
export const maxDuration = 300
export const dynamic = 'force-dynamic'
However, this change did not yield the desired results. I also experimented with adding a vercel.json
file at the root level (above /src
) like this:
{
"functions": {
"pages/api/**": {
"memory": 3008,
"maxDuration": 300
},
}
}
Despite these efforts, the problem persists. I have carefully reviewed the documentation (primarily referenced here) and various discussions (like this one), but none have provided a solution.
The current setup includes NextJs version 13.5.6
, confirmed pro plan status, and Node v18. I'm struggling to identify the error in my approach. Any suggestions or guidance would be greatly appreciated.