angular-cli: ng help generate: crashes on Angular 5.2.2
Versions
$ ng --version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 1.6.6
Node: 8.9.4
OS: win32 x64
Angular: 5.2.2
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
@angular/cli: 1.6.6
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.6
@schematics/angular: 0.1.17
typescript: 2.4.2
webpack: 3.10.0
Windows Version: Windows 10 Version 1709
Repro steps
- ng help generate
- Alternative: ng help generate service
Observed behavior
$ ng help generate service
Cannot read property '0' of undefined
TypeError: Cannot read property '0' of undefined
at Class.getCollectionName (D:\Users\harbmihi\Projects\WebProjects\Learning\Udemy\Angular5\Downloads\services-start\node_modules\@angular\cli\commands\generate.js:57:36)
at Class.printDetailedHelp (D:\Users\harbmihi\Projects\WebProjects\Learning\Udemy\Angular5\Downloads\services-start\node_modules\@angular\cli\commands\generate.js:179:37)
at commandFiles.forEach.cmd (D:\Users\harbmihi\Projects\WebProjects\Learning\Udemy\Angular5\Downloads\services-start\node_modules\@angular\cli\commands\help.js:57:38)
at Array.forEach (<anonymous>)
at Class.run (D:\Users\harbmihi\Projects\WebProjects\Learning\Udemy\Angular5\Downloads\services-start\node_modules\@angular\cli\commands\help.js:36:22)
at resolve (D:\Users\harbmihi\Projects\WebProjects\Learning\Udemy\Angular5\Downloads\services-start\node_modules\@angular\cli\ember-cli\lib\models\command.js:261:20)
at new Promise (<anonymous>)
at Class.validateAndRun (D:\Users\harbmihi\Projects\WebProjects\Learning\Udemy\Angular5\Downloads\services-start\node_modules\@angular\cli\ember-cli\lib\models\command.js:240:12)
at Promise.resolve.then.then (D:\Users\harbmihi\Projects\WebProjects\Learning\Udemy\Angular5\Downloads\services-start\node_modules\@angular\cli\ember-cli\lib\cli\cli.js:140:24)
at <anonymous>
Desired behavior
- Program shall not crash
- Program shall give valid output
Mention any other details that might be useful (optional)
N/A
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 14
- Comments: 15
Commits related to this issue
- fix(@angular/cli): fix ng help. fixes #9412 — committed to Brocco/angular-cli by Brocco 6 years ago
- fix(@angular/cli): fix ng help. fixes #9412 — committed to Brocco/angular-cli by Brocco 6 years ago
- fix(@angular/cli): Fix help for generate command. fixes #9412 — committed to Brocco/angular-cli by Brocco 6 years ago
- fix(@angular/cli): Fix help for generate command. fixes #9412 — committed to Brocco/angular-cli by Brocco 6 years ago
- fix(@angular/cli): Fix help for generate command. fixes #9412 — committed to Brocco/angular-cli by Brocco 6 years ago
- fix(@angular/cli): Fix help for generate command. fixes #9412 — committed to angular/angular-cli by Brocco 6 years ago
- fix(@angular/cli): Fix help for generate command. fixes #9412 — committed to angular/angular-cli by Brocco 6 years ago
- fix(@angular/cli): fix ng help. fixes #9412 — committed to angular/angular-cli by Brocco 6 years ago
- fix(@angular/cli): Fix help for generate command. fixes #9412 — committed to d2clouds/speedray-cli by Brocco 6 years ago
This is not fixed in 1.6.7:
The behavior of the help generate command:
Still occurs on 1.7.0-rc.0
Really missing this functionality in IntelliJ ._.
Noticed this issue too because Webstorm is using this command to know the available things that generate can do. This issue seems to only exists on
@angular/cli==1.6.6
; because when i downgrade to@angular/cli==1.6.5
the issue doesn’t occur anymore.Still occurs with 1.6.8
Dennis from WebStorm team here. I can confirm that this fails with the same output for me. We’ll be releasing WebStorm 2017.3.4 with a workaround (loading predefined list if the command fails), but would love to get a proper fix.