mirror of https://github.com/vuejs/core.git
fix(hydration): swap client/server labels for hydration mismatch warnings
this was swapped in #9098 but lost when merging #5953
This commit is contained in:
parent
ef688ba92b
commit
f41fd86d5f
|
@ -173,10 +173,10 @@ export function createHydrationFunctions(
|
|||
warn(
|
||||
`Hydration text mismatch in`,
|
||||
node.parentNode,
|
||||
`\n - rendered on server: ${JSON.stringify(vnode.children)}` +
|
||||
`\n - expected on client: ${JSON.stringify(
|
||||
(node as Text).data
|
||||
)}`
|
||||
`\n - rendered on server: ${JSON.stringify(
|
||||
(node as Text).data
|
||||
)}` +
|
||||
`\n - expected on client: ${JSON.stringify(vnode.children)}`
|
||||
)
|
||||
;(node as Text).data = vnode.children as string
|
||||
}
|
||||
|
@ -431,8 +431,8 @@ export function createHydrationFunctions(
|
|||
warn(
|
||||
`Hydration text content mismatch on`,
|
||||
el,
|
||||
`\n - rendered on server: ${vnode.children as string}` +
|
||||
`\n - expected on client: ${el.textContent}`
|
||||
`\n - rendered on server: ${el.textContent}` +
|
||||
`\n - expected on client: ${vnode.children as string}`
|
||||
)
|
||||
el.textContent = vnode.children as string
|
||||
}
|
||||
|
@ -613,15 +613,15 @@ export function createHydrationFunctions(
|
|||
hasMismatch = true
|
||||
;(__DEV__ || __FEATURE_PROD_HYDRATION_MISMATCH_DETAILS__) &&
|
||||
warn(
|
||||
`Hydration node mismatch:\n- Client vnode:`,
|
||||
vnode.type,
|
||||
`\n- Server rendered DOM:`,
|
||||
`Hydration node mismatch:\n- rendered on server:`,
|
||||
node,
|
||||
node.nodeType === DOMNodeTypes.TEXT
|
||||
? `(text)`
|
||||
: isComment(node) && node.data === '['
|
||||
? `(start of fragment)`
|
||||
: ``
|
||||
: ``,
|
||||
`\n- expected on client:`,
|
||||
vnode.type
|
||||
)
|
||||
vnode.el = null
|
||||
|
||||
|
|
Loading…
Reference in New Issue