From 33708e8bf44a037070af5c8eabdfe1ccad22bbc2 Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 1 Jul 2021 17:22:03 -0400 Subject: [PATCH] fix(ssr): ensure behavior consistency between prod/dev when mounting SSR app to empty containers close #4034 --- packages/runtime-core/src/hydration.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/runtime-core/src/hydration.ts b/packages/runtime-core/src/hydration.ts index 94c221db19..5f1ed828b2 100644 --- a/packages/runtime-core/src/hydration.ts +++ b/packages/runtime-core/src/hydration.ts @@ -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 -- 2.47.3