diff --git a/packages/babel-parser/src/parser/statement.ts b/packages/babel-parser/src/parser/statement.ts index 93a08a9c4119..d14b3aa47b98 100644 --- a/packages/babel-parser/src/parser/statement.ts +++ b/packages/babel-parser/src/parser/statement.ts @@ -2653,7 +2653,7 @@ export default abstract class StatementParser extends ExpressionParser { parseMaybeImportReflection(node: Undone) { let isImportReflection = false; - if (this.match(tt._module) && !this.state.containsEsc) { + if (this.isContextual(tt._module)) { const lookahead = this.lookahead(); if (tokenIsIdentifier(lookahead.type)) { if (lookahead.type !== tt._from) {