[▲ Vercel Community](/) · [Categories](/categories) · [Latest](/latest) · [Top](/top) · [Live](/live)

[Feedback](/c/feedback/8)

# Preflight OPTIONS error despite correct CORS configuration

59 views · 0 likes · 1 post


Thomas94170 (@thomas94170) · 2025-08-12

Hello everyone,

I’m currently facing an issue when deploying a NestJS API on Vercel:
**Preflight OPTIONS** requests consistently fail (401/403/405) even though:

* CORS is properly configured in `main.ts` (`origin`, `methods`, `allowedHeaders`, `credentials`).

* The `OPTIONS` routes correctly return a 204 with all required `Access-Control-Allow-*` headers.

* The routes have been allowed in `vercel.json` (for example `/auth/*`).

* I have temporarily disabled all security measures (auth middlewares, validations) to test, but the issue persists.

**Context:**

* Deployment on Vercel (`api/index.ts` properly set up to handle preflight)

* Cross-testing local ↔ staging: works fine locally, fails on Vercel

* This strongly appears to be an internal Vercel issue (support ticket already opened)

**My question:**
Has anyone encountered this issue before?
Do you know of a solution or workaround to make OPTIONS requests pass correctly on Vercel in this scenario?

Thanks in advance for your feedback!

![Capture d’écran 2025-08-12 à 10.51.50|690x89](upload://r8CNn9VxYPIhJj9jaJranhxHGgJ.png)