Uh oh!
There was an error while loading. Please reload this page.
feat(vue): Rework tracing and add support for Vue 3 - #3804
Conversation
size-limit report
|
Kocal
commented
Jul 14, 2021
Thanks for this incredible PR, I will try it when I have free time! Just a question, I see you inject |
I didn't know that multiple Vue apps it's actually a thing, but here you go :) constappOne=Vue.createApp(App);constappTwo=Vue.createApp(App);constappThree=Vue.createApp(App);Sentry.init({app: [appOne,appTwo,appThree],}); |
Nice, thanks! I (we) have another advanced usecase with multiples Vue instances on a single page. On server-rendered websites, sometimes we create small components (and Vue instances) to add some interactivity on the page (e.g.: dropdowns, inputs with characters counters, modals...), but thoses instances are often created after Sentry has been initialized (since we initialize Sentry the ASAP). It was not a problem with Vue 2, but Vue 3 it is. 😕 Do you think it would be possible to listen on every Thanks! |
kamilogorek
commented
Jul 14, 2021
import*asSentryfrom'@sentry/vue';// ...constapp=createApp(App);Sentry.init({app: app// ...});constmiscApp=createApp(MiscApp);miscApp.mixin(Sentry.createTracingMixins({trackComponents: true}));Sentry.attachErrorHandler(miscApp,{logErrors: true});Although not a common use case I believe, this should do the job. |
Kocal
commented
Jul 14, 2021
That's awesome! Even if it's more verbose than a single Thanks for this! ❤️ |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
kamilogorek
commented
Jul 15, 2021
@AbhiPrasad updated |
AbhiPrasad
left a comment
There was a problem hiding this comment.
Wonder if we can ping someone in that Vue 3 GH issue or through the Vue community discord to get some more 👀 on it.
vaaski
commented
Jul 18, 2021
tjk
commented
Jul 18, 2021
@vaaski |
vaaski
commented
Jul 19, 2021
You're right, my bad. Works like a charm now! |
cawa-93
commented
Jul 22, 2021
How use it with import{VueasVueIntegration}from'@sentry/integrations';Sentry.init({dsn: import.meta.env.VITE_SENTRY_DSN,integrations: [newVueIntegration({??? }),],});I tried: newVueIntegration({ app }),but I got TS error: |
kamilogorek
commented
Jul 22, 2021
You don't. Vue integration predates a standalone Vue sdk. It has been replaced by it now. |
Seems this change introduces a type error, the Therefore TypeScript complains that I can't pass my router into Is this expected and should I adjust my code or is this a newly introduced bug? Please let me know if I should open a separate issue for this. |
kamilogorek
commented
Jul 27, 2021
@mac-cain13 fix is coming |


The examples below show how to use Error Tracking and Performance Tracing features. In case you don't want to use Performance Tracing,
integrations,tracesSampleRate,hooks, andtrackComponentscan be omited.Vue 2
Vue 3
Vue 3 - multiple apps
Vue 3 - adding app after initialization