Skip to content

🐞[add]: error while trying to add performance property  #867

@pranshuchittora

Description

@pranshuchittora

Describe the bug

Throws an error while using add command and trying to add performance property.
Happening only with the current code from the repo, not with the version on the npm.

What is the current behaviour?
Error

 ./node_modules/webpack-cli/bin/cli.js add 

✔ SUCCESS Found config webpack.config.js

? What property do you want to add to? performance
(node:8167) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'definitions' of undefined
    at prompt.then.then (/home/wasd/webpack/webpack-cli/packages/generators/add-generator.js:134:68)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:8167) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:8167) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

To Reproduce
Steps to reproduce the behaviour:
(Create a new directory & link the CLI repo)

  1. ./node_modules/webpack-cli/bin/cli.js init
  2. ./node_modules/webpack-cli/bin/cli.js add
  3. Scroll down and select performance
  4. Error

Expected behaviour
Congratulations! performance.assetFilter has been added!

Screenshots

Left = Current codebase
Right = Modules installed from NPM

Screenshot from 2019-04-28 17-47-26

Please paste the results of webpack-cli info here, and mention other relevant information

System:

  • OS: Linux 4.18 Ubuntu 18.10 (Cosmic Cuttlefish)
  • CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
  • Memory: 7.53 GB / 15.57 GB

Binaries:

  • Node: 10.12.0 - ~/.nvm/versions/node/v10.12.0/bin/node
  • Yarn: 1.12.3 - /usr/bin/yarn
  • npm: 6.5.0 - ~/.nvm/versions/node/v10.12.0/bin/npm

Browsers:

  • Chrome: 73.0.3683.103
  • Firefox: 66.0.3

npmPackages:

  • terser-webpack-plugin: ^1.2.3 => 1.2.3
  • webpack: ^4.30.0 => 4.30.0
  • webpack-cli: ^3.3.1 => 3.3.0

npmGlobalPackages:

  • webpack-cli: 3.3.0
  • webpack: 4.27.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions