diff --git a/src/utils/vnodes.ts b/src/utils/vnodes.ts index 09871e603..27ca5f80a 100644 --- a/src/utils/vnodes.ts +++ b/src/utils/vnodes.ts @@ -24,6 +24,11 @@ type VueInstance = { // sort children instances by vnodes order export function sortChildren(children: VueInstance[], parent: VueInstance) { + // null on SSR + if (!parent._vnode) { + return; + } + const vnodes = flattenVNodes(parent._vnode.children!); children.sort((a, b) => vnodes.indexOf(a.$vnode) - vnodes.indexOf(b.$vnode)); }