From e422b8b082f1765f596c3ae0ff5b2e65d756405a Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 22 Apr 2020 04:39:02 -0400 Subject: [PATCH] fix(runtime-core): only infer component name for object components close #1023 --- packages/runtime-core/src/helpers/resolveAssets.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/runtime-core/src/helpers/resolveAssets.ts b/packages/runtime-core/src/helpers/resolveAssets.ts index 40440f6c..8cb134d5 100644 --- a/packages/runtime-core/src/helpers/resolveAssets.ts +++ b/packages/runtime-core/src/helpers/resolveAssets.ts @@ -77,7 +77,11 @@ function resolveAsset( if (__DEV__) { if (res) { // in dev, infer anonymous component's name based on registered name - if (type === COMPONENTS && !(res as Component).name) { + if ( + type === COMPONENTS && + isObject(res) && + !(res as ComponentOptions).name + ) { ;(res as ComponentOptions).name = name } } else if (warnMissing) {