diff --git a/packager/src/node-haste/index.js b/packager/src/node-haste/index.js index 0357f7b46..c182ead5b 100644 --- a/packager/src/node-haste/index.js +++ b/packager/src/node-haste/index.js @@ -81,7 +81,7 @@ class DependencyGraph { _helpers: DependencyGraphHelpers; _moduleCache: ModuleCache; - _loading: Promise; + _loading: Promise; constructor(opts: Options) { this._opts = {...opts}; @@ -89,7 +89,7 @@ class DependencyGraph { this.load(); } - load() { + load(): Promise { if (this._loading) { return this._loading; } @@ -164,7 +164,6 @@ class DependencyGraph { log(createActionEndEntry(buildingHasteMapLogEntry)); log(createActionEndEntry(initializingPackagerLogEntry)); this._opts.reporter.update({type: 'dep_graph_loaded'}); - return map; }, err => { const error = new Error( @@ -300,7 +299,7 @@ class DependencyGraph { this._hasteMapError = null; // Rebuild the entire map if last change resulted in an error. - this._loading = this._hasteMap.build(); + this._loading = this._hasteMap.build().then(() => {}); } else { this._loading = this._hasteMap.processFileChange(type, filePath); this._loading.catch(error => {