New Browser SDK doesn't seem to work for AngularJS

I was earlier using Raven.js and found the source maps were not always used by sentry. So I did the two changes

  1. Upload source maps to Sentry using webpack plugin

  2. Use the new SDK

    Sentry.init({
    dsn: process.env.SENTRY_DSN,
    environment: ‘some-env’,
    release: build-xxxx,
    logLevel: ‘Error’,
    })

I initialize Sentry as the first step when the script is loaded.

I dont see any XHR/WS requests to sentry. I did debug the sentry code a bit and saw it uses XHRTransport, so may be the global error handlers were not configured ?

Also I dont see any events in my Sentry events console.

Questions

  • How do I know that sentry was initialized or not?
  • Do Sentry SDK by itself adds global error handlers or do I need to do anything manually ? Doesn’t seem like the global handlers get automatically configured

Seems like Sentry doesn’t add global handlers by default. I think this should be clearly mentioned in the documentation.

Hey, so we defiantly do add global error handlers by default throw new Error('test') after Sentry.init should show up in your account.

What version of @sentry/browser are you using?

Also a minor detail, there is no logLevel option in the init() call, you can find all possible options here: https://docs.sentry.io/error-reporting/configuration/?platform=browser

Might be a newbie question. But is Raven still needed for the new js SDK? I am finding that I can generate sentry errors with the SDK, but common AngularJS errors do not see to get caught or send to the API.

The docs seem to say that the old angularjs has been replaced with the new SDK, and I do not see any reference to raven on the new docs.

Update: Ok sorry, seems I needed to add ‘ngSentry’ to my app dependencies. It might help to have a migration not in the new SDK docs to help users bridge the two configurations. Thanks!