Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webpack Unknown option '--display-error-details'

I am in the process of upgrading webpack from v4 to v5.

I have started with upgrading webpack-cli, as explained in the doc.

So when I run npx webpack --version I get

webpack 4.46.0
webpack-cli 4.5.0

Now I try to run the following command : npx webpack --display-error-details. The documentation of the webpack cli for v4 says this option is available.

But I get Error: Unknown option '--display-error-details'

What am I missing?

like image 547
Istopopoki Avatar asked Jun 10 '26 00:06

Istopopoki


2 Answers

For the version 5.x of webpack you have to specify stats.errorDetails to true at the webpack config, like follows:

const customConfig = {
   stats: {
      errorDetails: true,
      children: true
   },
}
like image 112
Малъ Скрылевъ Avatar answered Jun 11 '26 20:06

Малъ Скрылевъ


As I know that from the webpack-cli ^4.x (which works with webpack v5) this option is deprecated which means this option is only available at lower version such as ^3.x version.

So in order to work with ^4.x, you might check all the available options here to find what you need or you can npx webpack --help.

like image 23
tmhao2005 Avatar answered Jun 11 '26 18:06

tmhao2005