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 Nov 19, 2020
1 parent 8bf050a commit c1d939b
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 @@ -16,7 +16,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 c1d939b

Please sign in to comment.