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) }