diff --git a/packages/bsb-js/utils.js b/packages/bsb-js/utils.js index 07190fc..5135dc5 100644 --- a/packages/bsb-js/utils.js +++ b/packages/bsb-js/utils.js @@ -7,6 +7,7 @@ const fileNameRegex = /\.(ml|re)$/ const es6ReplaceRegex = /(from\ "\.\.?\/.*?)(\.bs\.js|\.js)("\;)/g const commonJsReplaceRegex = /(require\("\.\.?\/.*?)(\.bs\.js|\.js)("\);)/g const getErrorRegex = /(File [\s\S]*?:\r?\n|Fatal )[eE]rror: [\s\S]*?(?=ninja|\r?\n\r?\n|$)/g +const packageNotFoundRegex = /Package not found[\s\S]*?:?\r?\n[\s\S]*?[eE]rror:\s?[\s\S]*/g const getSuperErrorRegex = /We've found a bug for you![\s\S]*?(?=ninja: build stopped)/g const getWarningRegex = /((File [\s\S]*?Warning.+? \d+:)|Warning number \d+)[\s\S]*?(?=\[\d+\/\d+\]|$)/g @@ -38,6 +39,7 @@ function processBsbError(err /*: Error | string */) { return ( err.match(getSuperErrorRegex) || err.match(getErrorRegex) || + err.match(packageNotFoundRegex) || [] ).map(e => new Error(e)) } else if (err instanceof Error) {