Lovable
deployment
CORS Error in Production Blocking Supabase Requests
API requests to Supabase fail with CORS error in production. 'Access-Control-Allow-Origin' header missing or not matching domain. Works locally but fails on deployed site.
CORS policy requires server to explicitly allow requests from client domain. Browser blocks cross-origin requests without proper headers.
Error Messages You Might See
Access-Control-Allow-Origin header is missing
CORS policy blocked request
The value of the Access-Control-Allow-Origin is not a match
Common Causes
- Supabase project not configured to allow production domain
- Using wrong domain in CORS settings (www vs non-www)
- Production domain not in Supabase allowed origins list
- Missing API key or using wrong key tier
- localhost still in allowed origins blocking production domain
How to Fix It
In Supabase dashboard > Project Settings > API > CORS config, add your production domain:
https://yourdomain.com
https://www.yourdomain.com
http://localhost:5173Use exact domains. Wildcards not allowed. Redeploy after updating.
Real developers can help you.
You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.
Get Help