Next.js Discord

Discord Forum

Error trying to increase maxDuration in vercel function

Answered
Wuchang bream posted this in #help-forum
Open in Discord
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 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
View full answer

19 Replies

Wuchang breamOP
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
Answer