diff --git a/packages/babel-compiler/babel-compiler.js b/packages/babel-compiler/babel-compiler.js index 1ed3115914..6ae5146c4e 100644 --- a/packages/babel-compiler/babel-compiler.js +++ b/packages/babel-compiler/babel-compiler.js @@ -125,16 +125,19 @@ BCp.processOneFileForTarget = function (inputFile, source) { }); } catch (e) { if (e.loc) { + // Error is from @babel/parser. inputFile.error({ message: e.message, line: e.loc.line, column: e.loc.column, }); - - return null; + } else { + // Error is from a Babel transform, with line/column information + // embedded in e.message. + inputFile.error(e); } - throw e; + return null; } if (isMeteorPre144) {