Skip to content

Commit fc53353

Browse files
kamilogorekHazAT
andauthored
fix: Change Vue interface to be inline with the original types (#2634)
Co-authored-by: Daniel Griesser <[email protected]>
1 parent 1fb0580 commit fc53353

File tree

1 file changed

+5
-8
lines changed
  • packages/integrations/src

1 file changed

+5
-8
lines changed

packages/integrations/src/vue.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ const TRACING_GETTER = ({
1111

1212
/** Global Vue object limited to the methods/attributes we require */
1313
interface VueInstance {
14-
config?: {
14+
config: {
1515
errorHandler?(error: Error, vm?: ViewModel, info?: string): void; // tslint:disable-line:completed-docs
1616
};
1717
mixin(hooks: { [key: string]: () => void }): void; // tslint:disable-line:completed-docs
18-
util: {
18+
util?: {
1919
warn(...input: any): void; // tslint:disable-line:completed-docs
2020
};
2121
}
@@ -338,11 +338,6 @@ export class Vue implements Integration {
338338

339339
/** Inject Sentry's handler into owns Vue's error handler */
340340
private _attachErrorHandler(getCurrentHub: () => Hub): void {
341-
if (!this._options.Vue.config) {
342-
logger.error('Vue instance is missing required `config` attribute');
343-
return;
344-
}
345-
346341
const currentErrorHandler = this._options.Vue.config.errorHandler; // tslint:disable-line:no-unbound-method
347342

348343
this._options.Vue.config.errorHandler = (error: Error, vm?: ViewModel, info?: string): void => {
@@ -379,7 +374,9 @@ export class Vue implements Integration {
379374
}
380375

381376
if (this._options.logErrors) {
382-
this._options.Vue.util.warn(`Error in ${info}: "${error.toString()}"`, vm);
377+
if (this._options.Vue.util) {
378+
this._options.Vue.util.warn(`Error in ${info}: "${error.toString()}"`, vm);
379+
}
383380
console.error(error); // tslint:disable-line:no-console
384381
}
385382
};

0 commit comments

Comments
 (0)