This documentation is for version 6 of the BugSnag JavaScript notifier. We recommend upgrading to the latest release using our Upgrade guide. Documentation for the current release can be found here.
BugSnag ignores cross domain script errors by default, because they contain no useful information. You can fix this by loading your script using CORS.
Add the CORS header to your web-server.
Access-Control-Allow-Origin: *
Add the crossorigin attribute to your script tag.
<script src="//cdn.example.com/site.js" crossorigin></script>
For more information, see our blog post.
Use the following configuration snippet. Replace /assets/
by the
path that contains your javascript.
location /assets/ {
add_header 'Access-Control-Allow-Origin: *';
}
Use the following policy
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<MaxAgeSeconds>1209600</MaxAgeSeconds>
</CORSRule>
</CORSConfiguration>