diff --git a/lib/Compilation.js b/lib/Compilation.js index d7406fba1..4c34ac374 100644 --- a/lib/Compilation.js +++ b/lib/Compilation.js @@ -3989,12 +3989,10 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o if (name) { const entrypoint = this.namedChunkGroups.get(name); if (entrypoint instanceof Entrypoint) { - if (entrypoint !== undefined) { - if (module) { - entrypoint.addOrigin(module, loc, request); - } - return entrypoint; + if (module) { + entrypoint.addOrigin(module, loc, request); } + return entrypoint; } else if (entrypoint) { throw new Error( `Cannot add an async entrypoint with the name '${name}', because there is already an chunk group with this name`