What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
If your browser error tracker reports only Script error., an uncaught JavaScript error probably occurred in a script loaded from another origin, but the browser withheld its details from the page’s error handler. The message is a visibility symptom, not proof that nothing went wrong. To expose useful details, configure the script for CORS and make sure its server permits the cross-origin request.
What “Script error.” means
A script served from a different origin can run on your page, yet the browser may limit what the page’s error handler can learn about an exception from that script. An origin differs if the protocol, hostname, or port differs. The handler may therefore receive a generic message instead of the exception text and stack details. As Sentry’s Ben Vinegar put it, “This isn’t a JavaScript bug – browsers intentionally hide errors originating from script files from different origins for security reasons.” Sentry explains the cross-origin “Script error.” behavior.
That generic report does not identify the underlying bug or prove which script caused it. Treat it as a signal to investigate the script’s origin and its CORS setup, not as an error to discard.
How to get details for a cross-origin script error
The browser needs cooperation from both the page markup and the server hosting the script. Adding the attribute alone is not sufficient: the response must also allow the requesting origin.
#1 Best Overall
- Identify the script and its origin. Check the script URL in your page and browser developer tools. Determine whether it is same-origin or comes from a CDN, another hostname, port, or protocol.
- Add the CORS attribute to the script element. For an external script, use
<script src="https://cdn.example.com/app.js" crossorigin="anonymous"></script>. Theanonymousmode does not send cross-origin credentials. - Allow the request on the script host. The server must return a suitable
Access-Control-Allow-Originresponse header for the page’s origin. The exact response policy depends on how the resource is served; confirm the response in the browser’s Network panel. - Reproduce the failure and inspect the report. Check the message, source URL, line, column, and error object. If the cross-origin response is not permitted, some details may remain blank or generic.
Sentry’s explanation of CORS and “Script error.” describes why the script attribute and the resource server’s response are both needed. Its article dates to 2016; use it for the security model and remedy, not as a current browser-compatibility chart. Browser-specific behavior can vary.
What window.onerror can—and cannot—tell you
The window.onerror property handler receives a message, source URL, line number, column number, and error object for a reported script error. Cross-origin restrictions can limit those values, so a handler may not receive a useful message or error object. MDN documents the Window error event and its handler arguments.
Rank #2
Do not treat this handler as a complete catch-all for JavaScript failures. The Window error event is used for synchronous script errors. An unhandled rejected promise—including an uncaught throw in an async function—uses a separate event, unhandledrejection. If asynchronous failures are missing from your reports, listen for and test that event separately; MDN documents this distinction in its Window error-event reference.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →When an error-monitoring SDK helps
An error-monitoring SDK can instrument an application, collect and normalize reports, and add diagnostic context. It does not override the browser’s security rules: it cannot recover details that the browser withholds because a cross-origin script response is not configured to permit access.
For example, Sentry describes its JavaScript error-reporting approach in its guide to capturing and reporting errors with window.onerror, updated September 24, 2025. Consider an SDK when you need centralized reporting or additional context, but first address the script and server configuration. Confirm current SDK behavior and setup in the vendor’s official documentation.
Quick Recap
Best Value
Rank #4
Choose the fix that addresses the cause
| Approach | What it can do | What it requires or cannot do |
|---|---|---|
| Configure CORS for the script | Allows the browser to expose normal error details for a cross-origin script when the configuration is valid. | You need control of the script markup and a resource-server response that permits the cross-origin request. |
| Add error-reporting instrumentation | Can capture and normalize exceptions and provide additional diagnostic context. | It does not replace correct cross-origin script and server configuration or bypass browser security restrictions. |
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

