Skip to content

Commit

Permalink
fix: handle childCompilation.errors being an iterator rather than a…
Browse files Browse the repository at this point in the history
…rray (#1863)
  • Loading branch information
alexander-akait authored Oct 17, 2024
1 parent ae85878 commit 4c0c894
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/child-compiler.js
Original file line number Diff line number Diff line change
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 4c0c894

Please sign in to comment.