From c7d74107bc6d878e215b81bda5b9b385539b87ed Mon Sep 17 00:00:00 2001 From: Michael Mok Date: Mon, 28 Jun 2021 01:28:30 +0200 Subject: [PATCH] fix: handle case when dep.request is undefined (#434) --- 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 });