Skip to content

Commit

Permalink
Handle childCompilation.errors being an iterator rather than array
Browse files Browse the repository at this point in the history
Fix #1846
  • Loading branch information
robert-irelan-tiktokusds committed Apr 12, 2024
1 parent 41f4a7b commit e36e671
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/child-compiler.js
Expand Up @@ -198,15 +198,15 @@ class HtmlWebpackChildCompiler {
childCompilation.errors &&
childCompilation.errors.length
) {
const errorDetails = childCompilation.errors
.map((error) => {
let message = error.message;
if (error.stack) {
message += "\n" + error.stack;
}
return message;
})
.join("\n");
const errorDetailsArray = [];
for (const error of childCompilation.errors) {
let message = error.message;
if (error.stack) {
message += "\n" + error.stack;
}
errorDetailsArray.push(message);
}
const errorDetails = errorDetailsArray.join("\n");

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

Expand Down

0 comments on commit e36e671

Please sign in to comment.