Skip to content

Commit

Permalink
fix: Patched 'formatWebpackMessage' for webpack 5
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaugen Zhuk committed Mar 29, 2021
1 parent 5fc8350 commit 1333c65
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/react-dev-utils/formatWebpackMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ function isLikelyASyntaxError(message) {

// Cleans up webpack error messages.
function formatMessage(message) {
let lines = message.split('\n');
let lines = [];

if (typeof message === 'string' || message instanceof String) {
lines = message.split('\n');
} else {
lines = [message.moduleName].concat(message.message.split('\n'));
}

// Strip webpack-added headers off errors/warnings
// https://github.com/webpack/webpack/blob/master/lib/ModuleError.js
Expand Down

0 comments on commit 1333c65

Please sign in to comment.