From 6b9b7bc9ea3f89772eaf1807e3b7478d39f3ef9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90?= Date: Sun, 26 Jun 2022 10:39:03 +0800 Subject: [PATCH] fix: compile error when no script (#38) --- src/transform.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/transform.ts b/src/transform.ts index d508797f..f984426f 100644 --- a/src/transform.ts +++ b/src/transform.ts @@ -304,7 +304,7 @@ async function doCompileTemplate( `$1 ${fnName}` )}` + `\n${COMP_IDENTIFIER}.${fnName} = ${fnName}` - if ((descriptor.script || descriptor.scriptSetup)!.lang === 'ts') { + if ((descriptor.script || descriptor.scriptSetup)?.lang === 'ts') { code = await transformTS(code) }