cross-origin error ⚛️ React

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.

Seen on: 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.

🧠 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.