From abeaa5bc9b14adce3c7059ad8c513d583bd5768a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Bigio?= Date: Tue, 27 Oct 2015 10:32:00 -0700 Subject: [PATCH] Improve error logging when rebuild fails Summary: public We're seeing intermittent errors on the packager when rebasing. Since this is very hard to repro lets add more logging to the warning we show just before starting to rebuild the entire haste map again Reviewed By: frantic Differential Revision: D2585427 fb-gh-sync-id: fbfa953f6c8ae78cbee2f3ab19ad494b084165c8 --- .../src/DependencyResolver/DependencyGraph/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/react-packager/src/DependencyResolver/DependencyGraph/index.js b/react-packager/src/DependencyResolver/DependencyGraph/index.js index 1baef52f..4c0a2168 100644 --- a/react-packager/src/DependencyResolver/DependencyGraph/index.js +++ b/react-packager/src/DependencyResolver/DependencyGraph/index.js @@ -211,9 +211,13 @@ class DependencyGraph { // we are in an error state and we should decide to do a full rebuild. this._loading = this._loading.finally(() => { if (this._hasteMapError) { + console.warn( + 'Rebuilding haste map to recover from error:\n' + + this._hasteMapError.stack + ); this._hasteMapError = null; + // Rebuild the entire map if last change resulted in an error. - console.warn('Rebuilding haste map to recover from error'); this._loading = this._hasteMap.build(); } else { this._loading = this._hasteMap.processFileChange(type, absPath);