From 41992a366f3376a4a43274e764816dab95e15f5d Mon Sep 17 00:00:00 2001 From: Zack Jackson Date: Tue, 18 Jul 2023 16:34:14 -0700 Subject: [PATCH] fix: thrown error during chunk correlation of empty graph connection (#1146) --- packages/node/src/plugins/ChunkCorrelationPlugin.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/node/src/plugins/ChunkCorrelationPlugin.js b/packages/node/src/plugins/ChunkCorrelationPlugin.js index 949dc6c1fcc..379c82b09fc 100644 --- a/packages/node/src/plugins/ChunkCorrelationPlugin.js +++ b/packages/node/src/plugins/ChunkCorrelationPlugin.js @@ -457,7 +457,9 @@ class FederationStatsPlugin { // Iterate over each dependency within the block. for (const dep of blockmodule.dependencies) { // Get the module that corresponds to the dependency. - const { module } = compilation.moduleGraph.getConnection(dep); + const connection = compilation.moduleGraph.getConnection(dep); + if(!connection) continue; + const { module } = connection; const moduleChunks = compilation.chunkGraph.getModuleChunksIterable(module); // Iterate over each chunk associated with the module.