MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / vueInit

Function vueInit

packages/vue/src/integration.ts:50–79  ·  view source on GitHub ↗
(app: Vue, options: Options)

Source from the content-addressed store, hash-verified

48});
49
50const vueInit = (app: Vue, options: Options): void => {
51 if (DEBUG_BUILD) {
52 // Check app is not mounted yet - should be mounted _after_ init()!
53 // This is _somewhat_ private, but in the case that this doesn't exist we simply ignore it
54 // See: https://github.com/vuejs/core/blob/eb2a83283caa9de0a45881d860a3cbd9d0bdd279/packages/runtime-core/src/component.ts#L394
55 const appWithInstance = app as Vue & {
56 _instance?: {
57 isMounted?: boolean;
58 };
59 };
60
61 const isMounted = appWithInstance._instance?.isMounted;
62 if (isMounted === true) {
63 consoleSandbox(() => {
64 // eslint-disable-next-line no-console
65 console.warn(
66 '[@sentry/vue]: Misconfigured SDK. Vue app is already mounted. Make sure to call `app.mount()` after `Sentry.init()`.',
67 );
68 });
69 }
70 }
71
72 if (options.attachErrorHandler) {
73 attachErrorHandler(app, options);
74 }
75
76 if (hasSpansEnabled(options)) {
77 app.mixin(createTracingMixins(options.tracingOptions));
78 }
79};

Callers 1

setupFunction · 0.85

Calls 5

consoleSandboxFunction · 0.90
attachErrorHandlerFunction · 0.90
hasSpansEnabledFunction · 0.90
createTracingMixinsFunction · 0.90
warnMethod · 0.65

Tested by

no test coverage detected