

The same-origin policy, enforced by modern browsers, means that scripts only have full access rights if they are loaded from the same origin domain as the original document-when the script passes the CORS validation. Script error–The same-origin policyĬORS, or Cross-Origin Resource Sharing, is an official W3C recommendation that defines the mechanism of properly making cross-origin requests on the client side. You can resolve the Long Running Script error by using coding best practices, modularizing your scripts, and thoroughly testing code before deployment under as many different conditions as possible. The user will also be presented with a dialog box where they can decide if they want to stop the script or keep waiting for their asset to load. If a script needs more time to execute, a Long Running Script error will occur. Every browser has a timeframe for script execution. While Script error is caused by violating the browser’s same-origin policy, a Long Running Script indicates performance issues. Their names are similar, but they are entirely different errors you need to handle differently. You may also find an error similar to Script error in your Raygun dashboard, called “Long Running Script”. However, it may also be a problem if the script is stored on the same domain but uses a different port, protocol (for example instead of or subdomain.įor example, an error within a script on another domain might look like this: As a result, the user’s browser stops the script from executing in order to prevent an attack called cross-site request forgery. Script errors are mostly likely to be caused by an error within a script that’s hosted on a different domain (for example, CDN scripts).

“Script error” is one of the most cryptic error messages you may encounter.


( 1606 words)Įditor’s Note: This article was updated December 2019 to be more up-to-date. Script error – What causes a Script error and how to solve them By Callum Gavin | Posted | 8 min.
