Skip to content

Commit

Permalink
Warn + recover on module lookup errors while analyzing dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffmo committed Jun 1, 2014
1 parent 9bbd9d8 commit d397b4e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/HasteModuleLoader/HasteModuleLoader.js
Expand Up @@ -298,9 +298,17 @@ Loader.prototype._getDependencyPathsFromResource = function(resource) {
resource.getModuleIDByOrigin(requiredModule) || requiredModule;
}

dependencyPaths.push(this._getRealPathFromNormalizedModuleID(
this._getNormalizedModuleID(resource.path, requiredModule)
));
try {
var moduleID = this._getNormalizedModuleID(resource.path, requiredModule);
} catch(e) {
console.warn(
'Could not find a `' + requiredModule + '` module while analyzing ' +
'dependencies of `' + resource.id + '`'
);
continue;
}

dependencyPaths.push(this._getRealPathFromNormalizedModuleID(moduleID));
}
return dependencyPaths;
};
Expand Down

0 comments on commit d397b4e

Please sign in to comment.