nuxt-community / sentry-module

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

fix: don't enable RewriteFrames integration by default #648

Closed rchl closed 7 months ago

rchl commented 7 months ago

After inspecting some crashes manually I've realized that the RewriteFrames integration that the module enables by default does more harm than good.

In case there are source maps it doesn't really make any difference since stack frame paths are resolved from source maps then.

In case there are no source maps (for example when crash is within the server code and not inside the webpack context) then what RewriteFrames does is it strips the whole path leaving just the file name. That can result in just index.js being shown, for example, which makes it unclear which file is being referred to.

Decided to not enable this integration by default as a fix rather than a breaking change.

It can easily be re-added manually and ideally with the root option specified to just strip the app's root path. And maybe shouldn't be added on the client side since on the client side the source maps should make it redundant.

github-actions[bot] commented 7 months ago

size-limit report 📦

Path Size
fixture: base 379.64 KB (-0.57% 🔽)
fixture: replay 498.79 KB (-0.43% 🔽)
fixture: lazy 384.43 KB (-0.56% 🔽)
fixture: tracing 399.83 KB (-0.54% 🔽)
fixture: lazy+tracing 404.59 KB (-0.53% 🔽)
fixture: typescript 379.77 KB (-0.57% 🔽)
rchl commented 7 months ago

Well, since the philosophy of Nuxt is to provide good defaults, I suppose I can set the root option to a good default value on the server instead...