From 436452dcbaa548dc4a7fdc5a06a3a1529db9541f Mon Sep 17 00:00:00 2001 From: Michael Mok Date: Sun, 27 Jun 2021 19:31:20 +0200 Subject: [PATCH] fix: handle case when dep.request is undefined --- lib/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index 3f9f88e7..2dc42372 100644 --- a/lib/index.js +++ b/lib/index.js @@ -87,8 +87,8 @@ class ReactRefreshPlugin { // Exhaustively search all entries for `integrationEntry`. // If found, mark those entries and the index of `integrationEntry`. for (const [name, entryData] of compilation.entries.entries()) { - const index = entryData.dependencies.findIndex((dep) => - dep.request.includes(integrationEntry) + const index = entryData.dependencies.findIndex( + (dep) => dep.request && dep.request.includes(integrationEntry) ); if (index !== -1) { socketEntryData.push({ name, index });