Istopopoki
Istopopoki

Reputation: 1762

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?

Upvotes: 8

Views: 15076

Answers (2)

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

Reputation: 16514

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
   },
}

Upvotes: 12

tmhao2005
tmhao2005

Reputation: 17524

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.

Upvotes: 8

Related Questions