PlainError

Access to fetch at 'https://api.example.com/data' from origin 'http://localhost:3000' has been blocked by CORS policy: N

Last checked 2026-10-26 · 2 fixes · reviewed answer

TL;DRA browser fetch request from your local web app was blocked because the remote API server did not include the required CORS header to permit access from your origin.

Most likely cause: The API server lacks configuration to send Access-Control-Allow-Origin headers for your localhost origin.

Try first: Update server CORS settings

Likely causes

  1. The API server lacks configuration to send Access-Control-Allow-Origin headers for your localhost origin.most likely
  2. Frontend code is making a direct cross-origin request without a proxy or server-side handling.possible

How to fix it

Safest first: SafeChanges settingsDangerous
  1. Update server CORS settingsSafe

    In the backend code, configure the response to include the header Access-Control-Allow-Origin set to http://localhost:3000 (or * for testing).

  2. Use a development proxyChanges settings

    If using a framework like React or Vite, add a proxy setting in the config file to route API calls through your local server.

If that didn't fix it

Inspect the failed request in the browser's Network tab to confirm the missing response headers.

When to see a technician

Contact the owner of the api.example.com server if you cannot modify its CORS configuration.

Quick answers

What does Access to fetch at 'https://api.example.com/data' from origin 'http://localhost:3000' has been blocked by CORS policy: N mean?
A browser fetch request from your local web app was blocked because the remote API server did not include the required CORS header to permit access from your origin.
What causes Access to fetch at 'https://api.example.com/data' from origin 'http://localhost:3000' has been blocked by CORS policy: N?
The API server lacks configuration to send Access-Control-Allow-Origin headers for your localhost origin. (most likely) Frontend code is making a direct cross-origin request without a proxy or server-side handling. (possible)
How do I fix Access to fetch at 'https://api.example.com/data' from origin 'http://localhost:3000' has been blocked by CORS policy: N?
Try these in order, safest first: 1. Update server CORS settings. 2. Use a development proxy.
What if that didn't fix it?
Inspect the failed request in the browser's Network tab to confirm the missing response headers.
When should I see a technician?
Contact the owner of the api.example.com server if you cannot modify its CORS configuration.
Did this fix it? Report a problem

Related errors

All Coding errors →