Skip to content

Commit 2f65914

Browse files
committed
fix: do not error for defineModule(undefined)
1 parent b2184c5 commit 2f65914

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/script-setup.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ function getDefineModelRuntimeDecl(node: CallExpression, context: Context): [Str
250250
return [arg0, arg1 as ObjectExpression]
251251
}
252252

253-
if (arg0 && arg0.type !== 'ObjectExpression') {
253+
if (arg0 && arg0.type !== 'ObjectExpression' && !(arg0.type === 'Identifier' && arg0.name === 'undefined')) {
254254
context.ctx.error(`Unexpected argument type for ${DEFINE_MODEL}().`, arg0)
255255
}
256256

0 commit comments

Comments
 (0)