-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vue integration does not work when using Sentry Client directly #3381
Comments
Related: #1969 @eslawski, after creating the hub, it needs to be registered as the Could you try: import Vue from "vue";
import * as Sentry from "@sentry/browser";
import { Vue as VueIntegration } from "@sentry/integrations";
import { makeMain } from "@sentry/hub";
const sentryClient = new Sentry.BrowserClient({
dsn: "blah",
integrations: [
...Sentry.defaultIntegrations,
new VueIntegration({
Vue,
attachProps: true,
logErrors: true
})
],
});
const sentryHub = new Sentry.Hub(sentryClient);
makeMain(sentryHub);
// ... And please let me know if that resolves the issue. |
Hey @onurtemizkan thanks for the response. So calling Specifically I am seeing that this Hub is now automatically handling ALL errors that occur on the page. I believe I tracked this down to the behavior of the That said, I was able to work around this by not supplying the During this process, I also noticed that the |
https://docs.sentry.io/platforms/javascript/guides/vue/ So there is a Vue SDK now And we also have this discussion with an example repo with tips for dealing with situation requiring multiple sentry instances. I would propose to close this issue, since the original problem is solved and we have a number of discussions around microfrontends and multiple sentry instance. Hope that is OK |
Thanks for the response @smeubank . If I am following your suggestion correctly, the Vue integration you recommend leverages So maybe this is more of a limitation for microfrontends at the moment? FWIW I have already filled out the request for feedback post you linked. Thanks! |
Package + Version
@sentry/browser
@sentry/integrations
Version:
Description
We are using the Sentry
BrowserClient
as follows:We understand that the
VueIntegration
is designed to hook into theVue.config.errorHandler
and automatically report errors out as they arise. We did some debugging, and can confirm that theerrorHandler
is properly attaching itself.However when an error is handled by this function, it never actually gets sent out to the Sentry. The root cause appears to be an issue with the
getCurrentHub()
not containing the Vue integration (this check fails).Using
BrowserClient
directly like this (as opposed toSentry.init
) is important to our microfrontend architecture where teams own smaller parts of a single page (sometimes even using different technologies: Vue, React, etc.). Having a way to report out errors to different dsns is a requirement for us. And we would love to be able to use the Vue Integration (and other technologies) too!The text was updated successfully, but these errors were encountered: