I received an error because of this code. Can I ask for some help how to fix this? Thank you.
for (const file of data_to_minify) {
try {
const [error, minifiedContent] = await tryToCatch(minify, file.file.filename, options);
if (error) {
console.error(`Failed to minify file ${file.file.filename}: ${error.message}`);
continue;
}
fs.writeFileSync(file.file.filename);
minifiedFiles.push({
filename: file.file.filename,
content: minifiedContent,
type: file.type
});
} catch (error) {
console.error(`Failed to process file ${file.file.filename}: ${error}`);
}
}