How to surpress sending TypeErrors

We use Sentry for our Vue.js project.

Version Info:

  • vue v2.5.2
  • @sentry/tracing v6.9.0
  • @sentry/vue v6.9.0

We have been receiving a large number of TypeError reports which takes up most of our monthly quota. Last week, to ignore TypeErrors, we have added whitelist urls to our sentry settings like below.

import * as Sentry from '@sentry/vue';
import { Integrations } from '@sentry/tracing';

Sentry.init({
  Vue: Vue,
  dsn: 'Sentry_DNS_url',
  whitelistUrls: [window.location.hostname], // This is the line added
  integrations: [new Integrations.BrowserTracing()],
  tracesSampleRate: 1.0,
  tracingOptions: {
    trackComponents: true
  },
  beforeBreadcrumb(breadcrumb, hint) {
    // omitted
  }
});
Sentry.setUser({
  // omitted
});
Vue.prototype.$sentry = Sentry;

At first, I have confirmed sentry stopped sending TypeErrors, but it strangely it now sends TypeErrors.

In our development environment, it doesn’t send TypeErrors but in staging and production environments, it sends TypeErrors.

Does someone have any clue why sentry behaves like this.

Also adding window.location.hostname to whitelist urls is the good practice to filter TypeErrors?