How to use Quasar.js with Sentry application monitoring
P粉323050780
P粉323050780 2024-03-26 12:52:42
0
1
466

I added Sentinel monitoring to my Quasar application but Sentinel does not receive any errors nor does it show up in its panel

I created /src/boot/sentry.js and wrote the following code:

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 application is ssr. How should I fix it?

P粉323050780
P粉323050780

reply all(1)
P粉032977207

I solved my problem by changing the code as follows:

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

export default boot(({ Vue }) => {
  Sentry.init({
    dsn: "",
    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;
        },
      }),
    ],
  });
});
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template