<script src="https://browser.sentry-cdn.com/5.15.5/bundle.min.js" integrity="sha384-wF7Jc4ZlWVxe/L8Ji3hOIBeTgo/HwFuaeEfjGmS3EXAG7Y+7Kjjr91gJpJtr+PAT" crossorigin="anonymous"></script>
<script src="https://browser.sentry-cdn.com/5.15.5/reportingobserver.min.js" crossorigin="anonymous"></script>
<script src="https://browser.sentry-cdn.com/5.15.5/captureconsole.min.js" crossorigin="anonymous"></script>
<script src="https://browser.sentry-cdn.com/5.15.5/dedupe.min.js" crossorigin="anonymous"></script>
var SentryClientGlobal = new Sentry.BrowserClient({
environment: 'development',
dsn: 'secret',
integrations: [
...Sentry.defaultIntegrations,
new Sentry.Integrations.ReportingObserver(),
new Sentry.Integrations.CaptureConsole({
levels: ['error', 'warn']
}),
new Sentry.Integrations.Dedupe()
]
}),
SentryHubGlobal = new Sentry.Hub(SentryClientGlobal);
// Capture additional data
SentryHubGlobal.configureScope(function(scope) {
scope.setTag("siteid", SITEID);
scope.setTag('cID', CID);
if (LOGGED_IN) {
scope.setUser({ id: "<?= $u->uID ?>" });
}
});
console.error('Boom!'); // this is not captured in Sentry
Initializing a client and hub manually like this doesn’t capture the console errors that are otherwise logged if I just use Sentry.init()
and Sentry.configureScope
normally as mentioned in the docs.
What am I doing wrong here or is it a bug?