Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle childCompilation.errors being an iterator rather than array #1863

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading