diff --git a/packages/compiler-core/src/transforms/vSlot.ts b/packages/compiler-core/src/transforms/vSlot.ts index d39d15f4..94089f29 100644 --- a/packages/compiler-core/src/transforms/vSlot.ts +++ b/packages/compiler-core/src/transforms/vSlot.ts @@ -342,7 +342,7 @@ function hasScopeRef( node: TemplateChildNode | IfBranchNode | SimpleExpressionNode | undefined, ids: TransformContext['identifiers'] ): boolean { - if (!node) { + if (!node || Object.keys(ids).length === 0) { return false } switch (node.type) {