From: Evan You Date: Thu, 1 Jul 2021 21:22:03 +0000 (-0400) Subject: fix(ssr): ensure behavior consistency between prod/dev when mounting SSR app to empty... X-Git-Tag: v3.1.3~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=33708e8bf44a037070af5c8eabdfe1ccad22bbc2;p=thirdparty%2Fvuejs%2Fcore.git fix(ssr): ensure behavior consistency between prod/dev when mounting SSR app to empty containers close #4034 --- 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