diff --git a/scripts/print-warnings/print-warnings.js b/scripts/print-warnings/print-warnings.js index acc51de82465f..5da79068ede1d 100644 --- a/scripts/print-warnings/print-warnings.js +++ b/scripts/print-warnings/print-warnings.js @@ -38,7 +38,14 @@ function transform(file, enc, cb) { return; } - const ast = babylon.parse(source, babylonOptions); + let ast; + try { + ast = babylon.parse(source, babylonOptions); + } catch (error) { + console.error('Failed to parse source file:', file.path); + throw error; + } + traverse(ast, { CallExpression: { exit: function(astPath) {