How do I fix a CORS error in production?
Call the API through your own backend, which forwards the request and adds the correct headers. Never expose users to raw third-party CORS issues, and never ask users to disable CORS, because it is a security feature.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in How to Handle CORS Errors When Calling the Swiggy API
It means the browser blocked the response because the server did not grant your origin permission. The request actually reached the server; the browser just refused to hand you the response because the required CORS headers were missing.
Use a proxy. Configure one in your bundler or run a small backend proxy. The proxy makes the request from a server-side origin, bypassing the browser's CORS rules entirely for local development.
Only for quick local testing. It disables CORS in your browser, which works in development but is not a real solution and must never be used in production or asked of users.
Still have questions?
Browse all our FAQs or reach out to our support team
