Skip to content

Commit 25190a5

Browse files
fix: handle childCompilation.errors being an iterator rather than array
1 parent ae85878 commit 25190a5

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/child-compiler.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -198,15 +198,15 @@ class HtmlWebpackChildCompiler {
198198
childCompilation.errors &&
199199
childCompilation.errors.length
200200
) {
201-
const errorDetails = childCompilation.errors
202-
.map((error) => {
203-
let message = error.message;
204-
if (error.stack) {
205-
message += "\n" + error.stack;
206-
}
207-
return message;
208-
})
209-
.join("\n");
201+
const errorDetailsArray = [];
202+
for (const error of childCompilation.errors) {
203+
let message = error.message;
204+
if (error.stack) {
205+
message += "\n" + error.stack;
206+
}
207+
errorDetailsArray.push(message);
208+
}
209+
const errorDetails = errorDetailsArray.join("\n");
210210

211211
reject(new Error("Child compilation failed:\n" + errorDetails));
212212

0 commit comments

Comments
 (0)