diff --git a/compiler/packages/eslint-plugin-react-compiler/src/rules/ReactCompilerRule.ts b/compiler/packages/eslint-plugin-react-compiler/src/rules/ReactCompilerRule.ts index fd33ae0339a1d..7c46cf0b88458 100644 --- a/compiler/packages/eslint-plugin-react-compiler/src/rules/ReactCompilerRule.ts +++ b/compiler/packages/eslint-plugin-react-compiler/src/rules/ReactCompilerRule.ts @@ -124,12 +124,14 @@ const rule: Rule.RuleModule = { }); } catch {} } else { - babelAST = HermesParser.parse(sourceCode, { - babel: true, - enableExperimentalComponentSyntax: true, - sourceFilename: filename, - sourceType: "module", - }); + try { + babelAST = HermesParser.parse(sourceCode, { + babel: true, + enableExperimentalComponentSyntax: true, + sourceFilename: filename, + sourceType: "module", + }); + } catch {} } if (babelAST != null) {