]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: warning for outdated hmr api usage
authorEvan You <yyx990803@gmail.com>
Sat, 21 Nov 2020 21:06:50 +0000 (16:06 -0500)
committerEvan You <yyx990803@gmail.com>
Sat, 21 Nov 2020 21:06:50 +0000 (16:06 -0500)
packages/runtime-core/src/hmr.ts

index 9a2d20def5173ce438456c28df4f17f324a769b8..7f28b2c7aff82012096e590090d65ba864f85712 100644 (file)
@@ -9,6 +9,7 @@ import {
 } from './component'
 import { queueJob, queuePostFlushCb } from './scheduler'
 import { extend } from '@vue/shared'
+import { warn } from './warning'
 
 export let isHmrUpdating = false
 
@@ -67,6 +68,14 @@ function createRecord(
   id: string,
   component: ComponentOptions | ClassComponent
 ): boolean {
+  if (!component) {
+    warn(
+      `HMR API usage is out of date.\n` +
+        `Please upgrade vue-loader/vite/rollup-plugin-vue or other relevant ` +
+        `depdendency that handles Vue SFC compilation.`
+    )
+    component = {}
+  }
   if (map.has(id)) {
     return false
   }