Angular- Following the instructions does not seem to activate sentry


#1

Hi, I’m trying to implement sentry in my project and I cant get it to work.

I’m using angular 6 , I run npm install @sentry/browser and then copied the code from the instructions into my main module (app.module.ts).

import * as Sentry from "@sentry/browser";

Sentry.init({
  dsn: "https://somenumbers@sentry.io/somenumbers"
});

@Injectable()
export class SentryErrorHandler implements ErrorHandler {
  constructor() { }
  handleError(error) {
    Sentry.captureException(error.originalError || error);
    throw error;
  }
}

No syntax errors, I imported ErrorHandler and Injectable from angular core.

Now I want to test this. I’m on my local computer (already tested that the filter for localhost in sentry settings is off) and I create a syntax error on one of the views of an angular component. then I navegate to that component and I get a nice error on my debug console but I dont get any events in sentry.

Is this how it’s supposed to work? Shouldnt i get a report?