From f14b99b2c0ddf73c6988dda8fe6b917e5f09295b Mon Sep 17 00:00:00 2001 From: Conor Hunt Date: Wed, 10 Apr 2019 11:22:14 -0400 Subject: [PATCH] fix: check that frozen.build exists before trying to access it If there is a compilation where frozen.build is not generated for some reason, then the check here would fail and throw an exception: Could not freeze FILE_NAME: Cannot read property 'hash' of undefined We check to see if the build exists and then fall through to regenerate if it does not. --- lib/TransformNormalModulePlugin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/TransformNormalModulePlugin.js b/lib/TransformNormalModulePlugin.js index 5b2a53dc..e91a7a58 100644 --- a/lib/TransformNormalModulePlugin.js +++ b/lib/TransformNormalModulePlugin.js @@ -598,7 +598,7 @@ class TransformNormalModulePlugin { module.request && (cacheable(module) || !module.built) && module instanceof NormalModule && - (!frozen || + (!frozen || !frozen.build || (schema >= 4 && module.hash !== frozen.build.hash) || (schema < 4 && module.getHashDigest(extra.compilation.dependencyTemplates) !==