Look at the browser console. A CORS error specifically mentions cross-origin or Access-Control headers. Other errors during a fetch, like network errors or 404s, are not CORS even though they happen during a request.
How to Fix CORS Errors in a React App (Step by Step)
How do I know if an error is actually CORS?
The answer
More FAQs in How to Fix CORS Errors in a React App (Step by Step)
Use a proxy in development to bypass browser CORS, and route through your own backend in production. If you control the API, set the Access-Control-Allow-Origin header. Never disable CORS for users.
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.
Call the third-party API through your own backend, which can forward the request and add the correct headers. Never expose users to raw third-party CORS issues, and never ask users to disable CORS.
Still have questions?
Browse all our FAQs or reach out to our support team
Want to upskill yourself?
Your learning library
Small steps. Big possibilities.
Find your next course. Build something great.