Next.js Discord

Discord Forum

504 Axios error on App directory with PRO PLAN

Oak apple gall wasp posted this in #help-forum
Open in Discord
Oak apple gall waspOP
I am encountering a 504 error on my request. I'm attempting to await some functionality from a serverless function that takes roughly 3 minutes to complete. I have upgraded my plan to PRO. Additionally, I've exported the maxDuration variable as follows:

export const maxDuration = 300;

I've also provided a vercel.json file, which essentially instructs Next.js to increase the serverless execution time to 300 seconds. Furthermore, I've increased the Axios timeout parameter. However, I'm still receiving a 504 error after 1 minute of loading time.

  "functions": {
    "app/api/generators/**/*.ts": {
      "memory": 3008,
      "maxDuration": 300

I have also updated axios timeout parameter

 const response = await, data, {
        responseType: "json",
        timeout: 300000, // 5 minutes

Please assist me with this issue.

0 Replies