Cause 1 of 6
This is fixed on the server, never in the browser. Send Access-Control-Allow-Origin: https://your-app.com from the API — in Express, app.use(cors({ origin: 'https://your-app.com' })). Avoid * on anything authenticated: it is incompatible with credentials and opens the endpoint to every site on the internet.
Cause 2 of 6
The preflight request is failing.
Any request with a custom header, or a content type other than the three simple ones, sends an OPTIONS preflight first. The server must answer that with a 2xx plus Access-Control-Allow-Methods and Access-Control-Allow-Headers covering what you send. Open the Network tab — the failing request is the OPTIONS, not the GET you wrote.
Cause 3 of 6
You send credentials but the server replies with a wildcard origin.
With credentials: 'include', the specification requires the server to echo one exact origin and to send Access-Control-Allow-Credentials: true. A * is rejected in that combination, by design.
Cause 4 of 6
The request actually failed and the error handler dropped the CORS headers.
A 500 that bypasses your CORS middleware surfaces in the browser as a CORS error, because the failed response carries no headers. Check the server logs and the real status code before changing any CORS config — the CORS message is a symptom here, not the cause.
Cause 5 of 6
You only need this to work in local development.
Use your dev server's proxy so the request is same-origin: server.proxy in Vite, rewrites in Next.js, proxy in Create React App. Do not disable web security in your browser or install an extension that strips CORS — that removes the protection for every site you visit, not just yours.
Cause 6 of 6
It is a third-party API with no CORS support at all.
Call it from your own backend and return the result to the browser from your own origin. Server-to-server requests are not subject to CORS, and it keeps the API key off the client, which a browser call cannot.