Skip to content

Commit a37a996

Browse files
committed
fix: add-emit-declaration will throw undefined type error
1 parent 4b8485c commit a37a996

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

transformations/add-emit-declaration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const transformAST: ASTTransformation = ({ root, j }) => {
3939

4040
if(!hasEmitsProperty){
4141
// no emits property then create emits:[...] AST
42-
defaultExportBody.get(0).node.declaration.properties.unshift(j.objectProperty(j.identifier('emits'),j.arrayExpression(elements)));
42+
defaultExportBody.get(0).node.declaration.properties?.unshift(j.objectProperty(j.identifier('emits'),j.arrayExpression(elements)));
4343
}
4444
}
4545
}

0 commit comments

Comments
 (0)