diff --git a/src/snyk/snykOss/services/vulnerabilityCount/parsers/babelParser.ts b/src/snyk/snykOss/services/vulnerabilityCount/parsers/babelParser.ts index c3ca96d01..e898fbb78 100644 --- a/src/snyk/snykOss/services/vulnerabilityCount/parsers/babelParser.ts +++ b/src/snyk/snykOss/services/vulnerabilityCount/parsers/babelParser.ts @@ -53,13 +53,13 @@ export class BabelParser extends ModuleParser { fileName, name: BabelParser.getModuleName(node), line: node.loc ? node.loc.end.line : null, - loc: node.arguments[0].loc, + loc: node.arguments[0].loc ? node.arguments[0].loc : null, string: BabelParser.compileRequireString(node), }); } else if (node.callee.type === 'Import') { modules.push({ fileName, - loc: node.arguments[0].loc, + loc: node.arguments[0].loc ? node.arguments[0].loc : null, name: BabelParser.getModuleName(node), line: node.loc ? node.loc.end.line : null, string: BabelParser.compileImportExpressionString(node),