fix(ssr): ensure behavior consistency between prod/dev when mounting SSR app to empty containers

close #4034
This commit is contained in:
Evan You 2021-07-01 17:22:03 -04:00
parent 34d4991dd5
commit 33708e8bf4

View 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