Skip to content

Commit 4740597

Browse files
committed
include component file location in warning if available
1 parent 1bb7cba commit 4740597

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/core/util/debug.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,17 @@ if (process.env.NODE_ENV !== 'production') {
2222
const name = vm._isVue
2323
? vm.$options.name || vm.$options._componentTag
2424
: vm.name
25-
return name ? `component <${name}>` : `anonymous component`
25+
return (
26+
(name ? `component <${name}>` : `anonymous component`) +
27+
(vm._isVue && vm.$options.__file ? ` at ${vm.$options.__file}` : '')
28+
)
2629
}
2730

2831
const formatLocation = str => {
2932
if (str === 'anonymous component') {
3033
str += ` - use the "name" option for better debugging messages.`
3134
}
32-
return `(found in ${str})`
35+
return `\n(found in ${str})`
3336
}
3437
}
3538

0 commit comments

Comments
 (0)