From 2fec6953f408265a79edaca07549463c592a7b08 Mon Sep 17 00:00:00 2001 From: Walter Montes Date: Tue, 18 Oct 2022 12:01:28 -0600 Subject: [PATCH 1/2] Safer isAsyncWrapper check It breaks if the vnode passed has type empty, it should not break and just return `false` for isAsyncWrapper --- packages/runtime-core/src/apiAsyncComponent.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/runtime-core/src/apiAsyncComponent.ts b/packages/runtime-core/src/apiAsyncComponent.ts index 41ccd94a744..e669e909241 100644 --- a/packages/runtime-core/src/apiAsyncComponent.ts +++ b/packages/runtime-core/src/apiAsyncComponent.ts @@ -38,7 +38,7 @@ export interface AsyncComponentOptions { } export const isAsyncWrapper = (i: ComponentInternalInstance | VNode): boolean => - !!(i.type as ComponentOptions).__asyncLoader + i && i.type ? !!(i.type as ComponentOptions).__asyncLoader : false export function defineAsyncComponent< T extends Component = { new (): ComponentPublicInstance } From 31a1bdcf124be3647337530217ac9d5e8e74eb69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20L=C3=BCnborg?= Date: Wed, 14 Dec 2022 13:55:41 +0100 Subject: [PATCH 2/2] Update packages/runtime-core/src/apiAsyncComponent.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 三咲智子 Kevin Deng --- packages/runtime-core/src/apiAsyncComponent.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/runtime-core/src/apiAsyncComponent.ts b/packages/runtime-core/src/apiAsyncComponent.ts index e669e909241..9e9ab39b904 100644 --- a/packages/runtime-core/src/apiAsyncComponent.ts +++ b/packages/runtime-core/src/apiAsyncComponent.ts @@ -38,7 +38,7 @@ export interface AsyncComponentOptions { } export const isAsyncWrapper = (i: ComponentInternalInstance | VNode): boolean => - i && i.type ? !!(i.type as ComponentOptions).__asyncLoader : false + !!(i && i.type && (i.type as ComponentOptions).__asyncLoader) export function defineAsyncComponent< T extends Component = { new (): ComponentPublicInstance }