@@ -589,6 +589,7 @@ function finishComponentSetup(
589
589
instance . render = Component . render as InternalRenderFunction
590
590
}
591
591
} else if ( ! instance . render ) {
592
+ // could be set from setup()
592
593
if ( compile && Component . template && ! Component . render ) {
593
594
if ( __DEV__ ) {
594
595
startMeasure ( instance , `compile` )
@@ -604,25 +605,6 @@ function finishComponentSetup(
604
605
; ( Component . render as InternalRenderFunction ) . _rc = true
605
606
}
606
607
607
- if ( __DEV__ && ! Component . render ) {
608
- /* istanbul ignore if */
609
- if ( ! compile && Component . template ) {
610
- warn (
611
- `Component provided template option but ` +
612
- `runtime compilation is not supported in this build of Vue.` +
613
- ( __ESM_BUNDLER__
614
- ? ` Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".`
615
- : __ESM_BROWSER__
616
- ? ` Use "vue.esm-browser.js" instead.`
617
- : __GLOBAL__
618
- ? ` Use "vue.global.js" instead.`
619
- : `` ) /* should not happen */
620
- )
621
- } else {
622
- warn ( `Component is missing template or render function.` )
623
- }
624
- }
625
-
626
608
instance . render = ( Component . render || NOOP ) as InternalRenderFunction
627
609
628
610
// for runtime-compiled render functions using `with` blocks, the render
@@ -642,6 +624,26 @@ function finishComponentSetup(
642
624
applyOptions ( instance , Component )
643
625
currentInstance = null
644
626
}
627
+
628
+ // warn missing template/render
629
+ if ( __DEV__ && ! Component . render && instance . render === NOOP ) {
630
+ /* istanbul ignore if */
631
+ if ( ! compile && Component . template ) {
632
+ warn (
633
+ `Component provided template option but ` +
634
+ `runtime compilation is not supported in this build of Vue.` +
635
+ ( __ESM_BUNDLER__
636
+ ? ` Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".`
637
+ : __ESM_BROWSER__
638
+ ? ` Use "vue.esm-browser.js" instead.`
639
+ : __GLOBAL__
640
+ ? ` Use "vue.global.js" instead.`
641
+ : `` ) /* should not happen */
642
+ )
643
+ } else {
644
+ warn ( `Component is missing template or render function.` )
645
+ }
646
+ }
645
647
}
646
648
647
649
const attrHandlers : ProxyHandler < Data > = {
0 commit comments