]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(ssr): ensure behavior consistency between prod/dev when mounting SSR app to empty...
authorEvan You <yyx990803@gmail.com>
Thu, 1 Jul 2021 21:22:03 +0000 (17:22 -0400)
committerEvan You <yyx990803@gmail.com>
Thu, 1 Jul 2021 21:22:03 +0000 (17:22 -0400)
close #4034

packages/runtime-core/src/hydration.ts

index 94c221db1950e641498750c2af2dbe6da335b772..5f1ed828b2cedfaaa4b8a1877e8cac96fd35e421 100644 (file)
@@ -57,12 +57,14 @@ export function createHydrationFunctions(
   } = rendererInternals
 
   const hydrate: RootHydrateFunction = (vnode, container) => {
-    if (__DEV__ && !container.hasChildNodes()) {
-      warn(
-        `Attempting to hydrate existing markup but container is empty. ` +
-          `Performing full mount instead.`
-      )
+    if (!container.hasChildNodes()) {
+      __DEV__ &&
+        warn(
+          `Attempting to hydrate existing markup but container is empty. ` +
+            `Performing full mount instead.`
+        )
       patch(null, vnode, container)
+      flushPostFlushCbs()
       return
     }
     hasMismatch = false