6

I added sentry monitoring to my quasar app but sentry does not receive any errors and does not show up in its panel

i created /src/boot/sentry.js and write this codes:

import { boot } from "quasar/wrappers";
import * as Sentry from "@sentry/vue";
import { BrowserTracing } from "@sentry/tracing";

export default boot(({ app, router }) => {
  Sentry.init({
    app,
    dsn: "<my sentry dns>",
    integrations: [
      new BrowserTracing({
        routingInstrumentation: Sentry.vueRouterInstrumentation(router),
        tracingOrigins: ["localhost", "my-site-url.com", regex],
      }),
    ],

    trackComponents: true,
    tracesSampleRate: 1.0,
  });
});

My Quasar app is ssr. How should i fix it?

Kasra Karami
  • 401
  • 5
  • 10
  • 2
    Do you have `sentry.js` in `boot:` section in your `quasar.conf.js`? If so, the code should run at the page refresh, which you can see in the console by adding some `console.log(..)` into `sentry.js`. – mirek Feb 25 '22 at 15:06
  • And what is `regex`? – mirek Feb 25 '22 at 15:08
  • 1
    Thanks alot. I forgot to change quasar.config.js but it did not work even after the change – Kasra Karami Feb 27 '22 at 09:25

1 Answers1

2

I solved my problem by changing the code as shown below:

import { boot } from "quasar/wrappers";
import * as Sentry from "@sentry/browser";
import * as Integrations from "@sentry/integrations";

export default boot(({ Vue }) => {
  Sentry.init({
    dsn: "<dns comes here>",
    release: process.env.SENTRY_RELEASE,
    integrations: [
      new Integrations.Vue({ Vue, attachProps: true }),
      new Integrations.RewriteFrames({
        iteratee(frame) {
          // Strip out the query part (which contains `?__WB_REVISION__=**`)
          frame.abs_path = frame.abs_path.split("?")[0];

          return frame;
        },
      }),
    ],
  });
});
Kasra Karami
  • 401
  • 5
  • 10