diff --git a/packages/runtime-core/src/vnode.ts b/packages/runtime-core/src/vnode.ts index f5ff1cdc3..943d43ab3 100644 --- a/packages/runtime-core/src/vnode.ts +++ b/packages/runtime-core/src/vnode.ts @@ -383,6 +383,11 @@ function _createVNode( appContext: null } + // validate key + if (__DEV__ && vnode.key !== vnode.key) { + warn(`VNode created with invalid key (NaN). VNode type:`, vnode.type) + } + normalizeChildren(vnode, children) // presence of a patch flag indicates this node needs patching on updates.