# Error: A cross-origin error was thrown. React doesn't have access to the actual error object in development.

**Code:** `cross-origin error` · **Category:** React · **Seen on:** React

An error happened in a script loaded from another origin, so the browser hid the details from React.

## Meaning

Development builds served from a different port/host or scripts without crossorigin hide error details. Often seen with CDN React builds or source-map/devtools setups.

## Common causes

- Scripts loaded cross-origin without crossorigin="anonymous"
- Code evaluated via eval-based source maps in some setups

## Quick fix

1. Serve scripts same-origin in development
2. Add crossorigin="anonymous" and CORS headers on the script host
3. Check the browser console for the original error

## Detailed fix by platform

### React

1. `<script crossorigin src="https://unpkg.com/react@18/umd/react.development.js"></script>`

## How to diagnose

1. **Source** — Which script origin?
2. **Recent change** — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/react/cross-origin-error-was-thrown)
