Increase Vercel Maximum Duration to 3 minutes
Hello everyone,
I've been really enjoying working with the t3 stack and have developed a project. Now, I need to extend the Maximum Execution Duration for one of my functions. I've tried making the following adjustments to my vercel.json:
{
"version": 2,
"functions": {
"pages/api/trpc/*/": {
"maxDuration": 180
}
}
}
However, I haven't seen the desired changes yet. Any insights?
7 Replies
are you on the pro tier
yeahhh
have you tried this approach?
https://vercel.com/docs/functions/serverless-functions/runtimes#max-duration
Vercel Documentation
Runtimes
Runtimes transform your source code into Functions, which are served by our Edge Network. Learn about the official runtimes supported by Vercel.
Given that I'm utilising Next.js version 13.4, I'm using the vercel.json approach for this configuration. I've structured the file like this:
{
"functions": {
"api/trpc/[trpc].ts": {
"maxDuration": 180
}
}
}
is this correct for trpc ?
woops vercel does not like that
Error: The pattern "api/trpc/[trpc].ts" defined in
functions
doesn't match any Serverless Functions.maybe try
api/trpc/*.ts
?building the project in vercel with this
"pages/api/trpc/[trpc].ts"
if that does not work then ill try api/trpc/*.ts
no luck for either one 😦
ive managed to fix, i just upgraded to nextjs 14 and in my trpc file i added
export const config = {
maxDuration: 180,
};
Hey, in which file specifically did you change this setting?
Im looking to do the same