Skip to content

Commit

Permalink
Merge pull request #15489 from webpack/dx/less-verbose-cache-warnings
Browse files Browse the repository at this point in the history
make cache warnings caused by build errors less verbose
  • Loading branch information
sokra committed Apr 4, 2022
2 parents c2079f7 + d94145e commit a9aa422
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/cache/PackFileCacheStrategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -639,10 +639,14 @@ class PackContentItems {
} catch (e) {
rollback(s);
if (e === NOT_SERIALIZABLE) continue;
logger.warn(
`Skipped not serializable cache item '${key}': ${e.message}`
);
logger.debug(e.stack);
const msg = "Skipped not serializable cache item";
if (e.message.includes("ModuleBuildError")) {
logger.log(`${msg} (in build error): ${e.message}`);
logger.debug(`${msg} '${key}' (in build error): ${e.stack}`);
} else {
logger.warn(`${msg}: ${e.message}`);
logger.debug(`${msg} '${key}': ${e.stack}`);
}
}
}
write(null);
Expand Down

0 comments on commit a9aa422

Please sign in to comment.