Error: A cross-origin error was thrown. React doesn't have access to the actual error object in development.
An error happened in a script loaded from another origin, so the browser hid the details from React.
A cross-origin error was thrownReact doesn't have access to the actual error object 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
- Serve scripts same-origin in development
- Add crossorigin="anonymous" and CORS headers on the script host
- Check the browser console for the original error
Detailed fix by platform
React
<script crossorigin src="https://unpkg.com/react@18/umd/react.development.js"></script>
How to diagnose
- Source — Which script origin?
- Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in React
- React must be in scope ReferenceError: React is not defined / 'React' must be in scope when using JSX
- No QueryClient set Error: No QueryClient set, use QueryClientProvider to set one
- Functions cannot be passed Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server".
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 14 Oct 2026