Error when trying to build bundle after upgrading to `4.20.0`

Bug report

What is the current behavior?
When trying to build a js bundle and publish like we used to, webpack reported this error:

TypeError: Cannot read property ‘properties’ of undefined

If the current behavior is a bug, please provide the steps to reproduce.
it’s hard to give u the exact webpack.config.js because it our company’s project.
But after analyze the problem, i find out that the problem may happen when webpack-cli@2.1.5 trying to work with webpack@4.20.0, some json may be not compatible with the older version.
And after i downgrade my webpack to webpack@4.18.1, then there won’t be any error and the building can be done correctly.

What is the expected behavior?

Other relevant information:
webpack version: 4.20.0
Node.js version: v10.8.0
Operating System: mac os high sierra 10.13.4
Additional tools:

Author: Fantashit

8 thoughts on “Error when trying to build bundle after upgrading to `4.20.0`

  1. You can also use 4.19.0
    We have also noticed our builds were broken today (yesterday everything was fine) so it’s exactly the problem with update to 4.20.0

  2. Same here

    [bundle] /usr/src/app/node_modules/webpack-cli/bin/config-yargs.js:89
    [bundle] describe:,
    [bundle] ^
    [bundle] TypeError: Cannot read property ‘properties’ of undefined
    [bundle] at module.exports (/usr/src/app/node_modules/webpack-cli/bin/config-yargs.js:89:48)
    [bundle] at /usr/src/app/node_modules/webpack-cli/bin/webpack.js:60:27
    [bundle] at Object. (/usr/src/app/node_modules/webpack-cli/bin/webpack.js:515:3)
    [bundle] at Module._compile (internal/modules/cjs/loader.js:689:30)
    [bundle] at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    [bundle] at Module.load (internal/modules/cjs/loader.js:599:32)
    [bundle] at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    [bundle] at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    [bundle] at Module.require (internal/modules/cjs/loader.js:637:17)
    [bundle] at require (internal/modules/cjs/helpers.js:20:18)

  3. We had a same issue, when we had webpack combined with webpack-cli.
    Solved by using 4.19.1

    "webpack": "4.19.1",
    "webpack-bundle-analyzer": "^2.13.1",
    "webpack-cli": "^2.1.4",
    "webpack-merge": "^4.1.2"
  4. I am still having this issue with the following:

    "webpack": "^4.29.6",
    "webpack-cli": "^2.1.5"

    For reference, my npm outdated ouput is:

    $ npm outdated
    Package                  Current   Wanted  Latest  
    babel-loader               7.1.5    7.1.5   8.0.5  
    css-loader               0.28.11  0.28.11   2.1.0  
    file-loader               1.1.11   1.1.11   3.0.1  
    file-saver                 1.3.8    1.3.8   2.0.1  
    nodemailer                 4.7.0    4.7.0   5.1.1  
    style-loader              0.21.0   0.21.0  0.23.1  
    uglifyjs-webpack-plugin    1.3.0    1.3.0   2.1.2  
    webpack-cli                2.1.5    2.1.5   3.2.3 

    Is there a ‘definitive’ solution to this issue at this stage?

    Maybe update webpack-cli to 3.2.3?

    Like this?

    npm install --save-dev webpack-cli@latest

    Or maybe this?

    npm install --save-dev webpack-cli@3.2.3

    Thank you.

    Edit: I am no expert, but this seemed to work for me:

    npm install --save-dev webpack-cli@3.2.3

Comments are closed.