diff --git a/packages/macros/src/babel/macros-babel-plugin.ts b/packages/macros/src/babel/macros-babel-plugin.ts index 5a946d3129..e1197069a8 100644 --- a/packages/macros/src/babel/macros-babel-plugin.ts +++ b/packages/macros/src/babel/macros-babel-plugin.ts @@ -127,9 +127,9 @@ export default function main(context: typeof Babel): unknown { if (specifier?.type !== 'StringLiteral') { let relativePath; let property; - if (specifier.type === 'BinaryExpression' && specifier.left.type === 'Identifier') { + if (specifier.type === 'BinaryExpression' && specifier.left.type === 'StringLiteral' && specifier.right.type === 'Identifier') { relativePath = specifier.left.value; - property = specifier.right.value; + property = specifier.right; } if (specifier.type === 'TemplateLiteral' && specifier.expressions[0].type === 'Identifier') { relativePath = specifier.quasis[0].value.cooked;