From 555430089e130ced054b78fc1aee077439ec20e5 Mon Sep 17 00:00:00 2001 From: David Aurelio Date: Tue, 16 Aug 2016 17:39:34 -0700 Subject: [PATCH] Remove cached bundle if update fails Summary: If a bundle failed to build, a file change would trigger the *update bundle* path, without ever being able to resolve the bundle. If a bundle can't be updated, we evict it from the cache. Reviewed By: cpojer Differential Revision: D3726567 fbshipit-source-id: a342f00c5a41364551194c33082718e5483fd7a4 --- packager/react-packager/src/Server/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packager/react-packager/src/Server/index.js b/packager/react-packager/src/Server/index.js index d9805792e..27122258c 100644 --- a/packager/react-packager/src/Server/index.js +++ b/packager/react-packager/src/Server/index.js @@ -252,6 +252,9 @@ class Server { deps.outdated.add(filePath); } }); + }).catch(e => { + debug(`Could not update bundle: ${e}, evicting from cache`); + delete this._bundles[key]; }); } } else {