No. 138·noun·also called cross-origin request, CORS error, Access-Control-Allow-Origin

CORS

A browser rule that blocks your page from reading data from another web address unless that address says it's allowed.

SPECIMEN · DIAGRAM · SEQUENCE
Your page
Browser
Other server
1fetch data from api site2who is asking?3allowed addresses list4data, or blocked
Definition

What it is

CORS (cross-origin resource sharing) is a safety check built into browsers. When a page at one address, like app.yourcompany.com, asks a different address, like api.yourcompany.com, for data, the browser first checks whether the other side agreed to be asked. If it didn't, the browser blocks the response and prints a red error in the console.

You meet it when your frontend and your backend live at different addresses, which is common with AI app builders and during local development. The request often reaches the server fine. The browser just refuses to hand the answer to your page. That is why the fix goes on the server that sends the data, not in the page asking for it.

The usual quick fix an agent reaches for is to allow every address. That works and is also the setting that lets any website read your data. Ask for your own address by name instead.

CORS is not a login problem and not a broken API. If the same request works from a terminal or another tool but fails in the browser, CORS is the likely cause.

Say it like a builder

How to ask for it

Vague

“My app shows a red error and the data won't load, something about access being blocked. Can you just make it work?”

Precise

“The browser console shows a CORS error when my frontend at app.example.com calls our API at api.example.com. Fix it on the API by allowing only that origin, not a wildcard, and make sure it also works for requests that send cookies.”

Why it works

"Make it work" invites an allow-everything shortcut or a change in the wrong place; "CORS" tells the agent the fix belongs on the server, and the prompt names which address to allow.

In the wild

You've seen this in

  • CThe red "blocked by CORS policy" line in the Chrome console when a Lovable or Bolt frontend calls a separate API
  • PA fetch to a third-party API that works in Postman but fails inside your own page
  • LA local app at localhost:3000 failing to reach a backend running on localhost:8000
Usage note

Often confused with