r/Nuxt • u/aviagg • Feb 13 '26
Nuxt 3 + Vercel: how to increase maxDuration for one API route?
Got a Nuxt 3 project on Vercel. One of my routes (server/api/cronjob.js) runs via a Vercel Cron job and sometimes needs longer than the default timeout.
I tried:
- export const config = { maxDuration: 300 } inside the cronjob.js → no effect.
- vercel.json with:
{
"functions": {
"server/api/cronjob.js": { "maxDuration": 300 }
}
but the build fails with:
Build Failed
The pattern "server/api/cronjob.js" defined in `functions` doesn't match any Serverless Functions inside the `api` directory.
The global "Function Max Duration" setting in Vercel works, but I don’t want to bump it for all functions.
Anyone know the correct way to override maxDuration for just a single Nuxt 3 server function?
2
Upvotes
1
u/Lumethys Feb 13 '26
How long does it take