Skip to content

Commit cdff169

Browse files
authored
Merge pull request #67 from oupirum/support_multiple_webpack_instances
Fix for 'chunk is not an instance of Chunk'
2 parents 6d68cef + afe1817 commit cdff169

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

index.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,14 @@ function getPath(compilation, source, chunk) {
355355
}
356356

357357
function isChunk(chunk, error) {
358-
if (!(chunk instanceof Chunk)) {
358+
if (
359+
!chunk ||
360+
(
361+
!chunk.modulesIterable &&
362+
!chunk.forEachModule &&
363+
!chunk.modules
364+
)
365+
) {
359366
throw new Error(typeof error === 'string' ? error : 'chunk is not an instance of Chunk');
360367
}
361368

0 commit comments

Comments
 (0)