I’m encountering an issue where my application works fine locally with express.js, but it fails after i deploy the backend server on vercel.
ProblemOverview :
After I deploy the backend server on vercel the link is accessible but when i use the link while fetching data in client site it give me cors policy error even though i have used it.
It also says uncaught in promiss type error: failed to fetch
Has anyone experiences a similar issue where the clinet site can fetch data locally but falls in vercel production without clear errors in the logs? any guidance or suggestions on how to resolve or debug it would be greatly appreciated.
I’d recommend familiarizing yourself with CORS and the Express cors middleware. Because the CORS configuration are very specific to what sort of request you are making and this is why you need to set the options specific to your use case.