Skip to content

Commit ad3e697

Browse files
committed
fix(vue): accounts for potential undefined options
When formatting the component name, options can be undefined. When it is, we return the ANONYMOUS_COMPONENT_NAME early Fixes #5204
1 parent 2a1689e commit ad3e697

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/vue/src/components.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ export const formatComponentName = (vm?: ViewModel, includeFile?: boolean): stri
3030
return ROOT_COMPONENT_NAME;
3131
}
3232

33+
// https://github.com/getsentry/sentry-javascript/issues/5204 $options can be undefined
34+
if (!vm.$options) {
35+
return ANONYMOUS_COMPONENT_NAME;
36+
}
37+
3338
const options = vm.$options;
3439

3540
let name = options.name || options._componentTag;

0 commit comments

Comments
 (0)