File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ export function lifecycleMixin (Vue: Class<Component>) {
4444 vm . $options . render = emptyVNode
4545 if ( process . env . NODE_ENV !== 'production' ) {
4646 /* istanbul ignore if */
47- if ( vm . $options . template ) {
47+ if ( vm . $options . template && vm . $options . template . charAt ( 0 ) !== '#' ) {
4848 warn (
4949 'You are using the runtime-only build of Vue where the template ' +
5050 'option is not available. Either pre-compile the templates into ' +
Original file line number Diff line number Diff line change @@ -34,6 +34,13 @@ Vue.prototype.$mount = function (
3434 if ( typeof template === 'string' ) {
3535 if ( template . charAt ( 0 ) === '#' ) {
3636 template = idToTemplate ( template )
37+ /* istanbul ignore if */
38+ if ( process . env . NODE_ENV !== 'production' && ! template ) {
39+ warn (
40+ `Template element not found or is empty: ${ options . template } ` ,
41+ this
42+ )
43+ }
3744 }
3845 } else if ( template . nodeType ) {
3946 template = template . innerHTML
You can’t perform that action at this time.
0 commit comments