Closed
Description
I am opening this issue because the original one was flagged as spam and I coudn't comment on it
#1703
I was able to solve this problem as described:
1 - Eject your project;
2 - Fix webpack configuration to port to webpack v5; how to do it?
There is also a comment which says something like
TODO remove in webpack 5
, remove the line below;
3 - Search for formatWebpackMessages(webpackMessages)
inside config/build.js
;
4 - Replace with the following block of code:
const webpackMessages = stats.toJson({
all: false,
warnings: true,
errors: true,
});
webpackMessages.errors = webpackMessages.errors.map(
/** @param {object|string} error either from webpack 4 or 5 */
(error) => (typeof error === 'string')? error: (error.message || ''),
);
messages = formatWebpackMessages(webpackMessages);
}
I hope this helps.
EDIT:
Since we have to support webpack v4 and v5, I made the above code detect if the error object is from webpack 4