From f69dbabf8794426c3e9ed33ae77dd8ce655eafd2 Mon Sep 17 00:00:00 2001 From: Kalven Schraut <30308012+kalvenschraut@users.noreply.github.com> Date: Tue, 16 May 2023 20:59:49 -0500 Subject: [PATCH] fix(compiler-sfc): fix props destructing default value type checking with unresolved type (#8340) close #8326 --- packages/compiler-sfc/src/script/defineProps.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/compiler-sfc/src/script/defineProps.ts b/packages/compiler-sfc/src/script/defineProps.ts index be99c6122ec..1ae5a16e3d6 100644 --- a/packages/compiler-sfc/src/script/defineProps.ts +++ b/packages/compiler-sfc/src/script/defineProps.ts @@ -311,11 +311,7 @@ function genDestructuredDefaultValue( const value = ctx.getString(defaultVal) const unwrapped = unwrapTSNode(defaultVal) - if ( - inferredType && - inferredType.length && - !inferredType.includes(UNKNOWN_TYPE) - ) { + if (inferredType && inferredType.length && !inferredType.includes('null')) { const valueType = inferValueType(unwrapped) if (valueType && !inferredType.includes(valueType)) { ctx.error(