Error trying to increase maxDuration in vercel function
Answered
Wuchang bream posted this in #help-forum
Wuchang breamOP
Hi. Using vercel.json to try and increase a maxTimeout for my edge function
it says: "Error: The pattern "api/user/buy-credits" defined in
"
it matches exactly
it says: "Error: The pattern "api/user/buy-credits" defined in
functions doesn't match any Serverless Functions."
it matches exactly
Answered by Wuchang bream
For furture viewers:
Include an absolute path from the root of your project to your edge function.
e.g: src/pages/api/user/buy-credits.ts
thanks @Ray
Include an absolute path from the root of your project to your edge function.
e.g: src/pages/api/user/buy-credits.ts
thanks @Ray
19 Replies
Wuchang breamOP
@Wuchang bream Hi. Using vercel.json to try and increase a maxTimeout for my edge function
it says: "Error: The pattern "api/user/buy-credits" defined in `functions` doesn't match any Serverless Functions.
"
it matches exactly
I think the key should be the file path of the route
eg. app/api/user/buy-credits/route.ts
eg. app/api/user/buy-credits/route.ts
add src to the front if you are using src folder
Wuchang breamOP
alright
"src/api/user/buy-credits.ts"
@Wuchang bream "src/api/user/buy-credits.ts"
yes try this
Wuchang breamOP
Error: The pattern "src/api/user/buy-credits.ts" defined in `functions` doesn't match any Serverless Functions.@Ray are you using nextjs?
Wuchang breamOP
14
could you show a screenshot of the folder structure?
Wuchang breamOP
sure
maybe pages/
src/pages/api/user/buy-credits.ts
you can also export a config in the file of the api route instead
// src/pages/api/user/buy-credits.ts
export const config = {
maxDuration: 150,
};@Ray src/pages/api/user/buy-credits.ts
Wuchang breamOP
Yeah seemed to of worked, its building rest of app now
Wuchang breamOP
For furture viewers:
Include an absolute path from the root of your project to your edge function.
e.g: src/pages/api/user/buy-credits.ts
thanks @Ray
Include an absolute path from the root of your project to your edge function.
e.g: src/pages/api/user/buy-credits.ts
thanks @Ray
Answer