Skip to content

Commit 230d37a

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 230d37a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/vue/src/components.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ const repeat = (str: string, n: number): string => {
2222
};
2323

2424
export const formatComponentName = (vm?: ViewModel, includeFile?: boolean): string => {
25-
if (!vm) {
25+
// https://github.com/getsentry/sentry-javascript/issues/5204 $options can be undefined
26+
if (!vm || !vm.$options) {
2627
return ANONYMOUS_COMPONENT_NAME;
2728
}
2829

0 commit comments

Comments
 (0)