NEXTJS API routes not working in production mode, getting a 502 error

2.5k Views Asked by At

ISSUE

I am unable to fetch my API routes in production mode and receiving an error of

VM15:1 GET https://movies-words-ts-86xlkq6rp.vercel.app/api/movies/tt5052448/words 502

Uncaught (in promise) Error: Request failed with status code 502
    at LYNF.e.exports (fcae4559c849ad3f0939b7cca63449d545e4627d.d32ee7ae9c5841de2d98.js:1)
    at Rn+g.e.exports (fcae4559c849ad3f0939b7cca63449d545e4627d.d32ee7ae9c5841de2d98.js:1)
    at XMLHttpRequest.p.onreadystatechange (fcae4559c849ad3f0939b7cca63449d545e4627d.d32ee7ae9c5841de2d98.js:1)

Though everything works perfectly fine in development mode.

File information

api page

next.config.js

code from where I am calling the route, dict.tsx

0

There are 0 best solutions below