From a5a087ef44df2649eed9db18abc174a3474926cc 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 --- react-packager/src/Server/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/react-packager/src/Server/index.js b/react-packager/src/Server/index.js index d9805792..27122258 100644 --- a/react-packager/src/Server/index.js +++ b/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 {