nuxt-community / sentry-module

Sentry module for Nuxt 2
https://sentry.nuxtjs.org
MIT License
501 stars 114 forks source link

Sentry Performance tracing does not work when lazy is set to true #590

Closed nieyuyao closed 1 year ago

nieyuyao commented 1 year ago

Version

@nuxtjs/sentry: 6.0.3 nuxt: 2.14.2

Sentry configuration

sentry: {
    tracesSampleRate: 0.1,
    lazy: true, //  works if set true
    vueOptions: {
      trackComponents: true,
    }

What is actually happening?

Sentry browser tracing is broken if lazy is false. But it works if lazy is true. Is this to be expected or a bug?

rchl commented 1 year ago

When using lazy, the Sentry is loaded lazily (after the main app has loaded). So I would expect that it does affect performance tracing as it will miss some early events or won't be able to hook some things. But I'm not sure myself to which extent it affects tracing.

nieyuyao commented 1 year ago

OK. It maybe a bug in 6.x 😂. Can I use version 7.x in nuxt@2 ?

rchl commented 1 year ago

This module uses Sentry 7.x - https://github.com/nuxt-community/sentry-module/blob/1ad3e0ab8ca777f3c52f60767d6c65c7613ba09e/package.json#L62-L66