:5173/watches:1 Access to fetch at ‘https://watch-websites-server-site-mr3f7mg2v-md-sabbir-khans-projects.vercel.app/watches’ from origin ‘http://localhost:5173’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.
When I used my website in locally, I didn’t get any data from the vercel API link
2
Answers
To resolve the CORS issue, you have several options:
Modify the Server to Allow CORS:
Ensure that your CORS headers are intact. Also you can use CORS as a middleware if needed.
So just as an example –
app.use(cors());
Also check if your vercel.json (if you are having one) is not having any overriding headers.