App running in local machine but giving error in deployed website

Hey, I’m working with a Replicate model and it’s running great locally. But when I deploy it, I’m getting a 504 error on the website.

I’m on the Hobby plan and wondering if upgrading to Pro might fix it. Could the timeout issue (10 seconds on Hobby) be the problem? I’ve double-checked my code and it looks good, but the error only happens on the website, not locally.

Any advice would be super helpful! Here’s a link for more context: https://www.promptly.co.in/try-on

Hi, @codewithshail!

Can you try debugging using the tips here?

Okay, so I’m getting this error in the Chrome console, but not in the Vercel logs. Everything else in my app seems to be working fine, including other AI integrations.

I’ve checked my pages.tsx and route.ts files, even gave the whole code to ChatGPT to see if there were any errors or if the structure was off. ChatGPT suggested the error might be due to the 10-second timeout on the Hobby plan, so I created a vercel.json file with this code:

{
“functions”: {
“pages/api/**/*.ts”: {
“maxDuration”: 60
}
}
}

Unfortunately, that didn’t fix the problem.

Could you take a look at the link I provided for more details about the error? I’m hoping you can shed some light on this!
I am using nextjs 14 and typescript

This is the error i am getting in my chrome console “Failed to load resource: the server responded with a status of 504 ()
page-f9a4141cf53d3a25.js:1
Y
code
:
“ERR_BAD_RESPONSE”
config
:
{transitional: {…}, adapter: Array(3), transformRequest: Array(1), transformResponse: Array(1), timeout: 0, …}
message
:
“Request failed with status code 504”
name
:
“AxiosError”
request
:
XMLHttpRequest {METHOD: ‘POST’, URL: ‘/ai-platform/api/video’, onreadystatechange: null, readyState: 4, timeout: 0, …}
response
:
{data: {…}, status: 504, statusText: ‘’, headers: eP, config: {…}, …}
stack
:
“AxiosError: Request failed with status code 504\n at eF (https://www.promptly.co.in/_next/static/chunks/8472-d65a212f08eeaea9.js:1:16704)\n at XMLHttpRequest.y (https://www.promptly.co.in/_next/static/chunks/8472-d65a212f08eeaea9.js:1:21523)\n at tu.request (https://www.promptly.co.in/_next/static/chunks/8472-d65a212f08eeaea9.js:1:29263)\n at async y (https://www.promptly.co.in/_next/static/chunks/app/(ai)/(main)/ai-platform/(routes)/video-generation/page-f9a4141cf53d3a25.js:1:606)\n at async https://www.promptly.co.in/_next/static/chunks/9343-686a1da7eac5cac6.js:1:18750
[[Prototype]]
:
Error”

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.