Next.js Discord

Discord Forum

How the heck do you increase the duration of a serverless function in app router?

Unanswered
Himalayan posted this in #help-forum
Open in Discord
Avatar
HimalayanOP
I'm tearing my hair out trying to give my react server component a longer timeout. I'm doing some syncing work with an external service that takes ~15s.
Vercel.json is just not respected, and I get many lines of warnings in my build if I try that look like:
WARNING: Unable to find source file for page _not-found.js with extensions: tsx, ts, jsx, js, this can cause functions config from `vercel.json` to not be applied


I omitted the rest, but there are many more that are just other pages in my app.

If I try to export it from the page.tsx, I get "maxDuration" is not a valid Next.js entry export value.ts(71002)"

I am on a pro account. Version is "next": "~14.0.3"
vercel.json:
{
  "functions": {
    "src/app/(pages)/**/*": {
      "maxDuration": 120
    }
  }
}

No matter what I do, when I check the function duration on my deployment it says 15s is the max.
I've read probably every thread, doc, and discord post about this... Am I missing something? Is this a bug?

0 Replies