question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ng help generate: crashes on Angular 5.2.2

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:14
  • Comments:15

github_iconTop GitHub Comments

4reactions
h-bexcommented, Feb 1, 2018

This is not fixed in 1.6.7:

ng --version

    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/

Angular CLI: 1.6.7
Node: 8.9.4
OS: win32 x64
Angular:
...

The behavior of the help generate command:

ng help generate
Cannot read property '0' of undefined
TypeError: Cannot read property '0' of undefined
    at Class.getCollectionName (D:\Users\harbmihi\AppData\Roaming\npm\node_modules\@angular\cli\commands\generate.js:57:36)
    at Class.printDetailedHelp (D:\Users\harbmihi\AppData\Roaming\npm\node_modules\@angular\cli\commands\generate.js:179:37)
    at commandFiles.forEach.cmd (D:\Users\harbmihi\AppData\Roaming\npm\node_modules\@angular\cli\commands\help.js:57:38)
    at Array.forEach (<anonymous>)
    at Class.run (D:\Users\harbmihi\AppData\Roaming\npm\node_modules\@angular\cli\commands\help.js:36:22)
    at resolve (D:\Users\harbmihi\AppData\Roaming\npm\node_modules\@angular\cli\ember-cli\lib\models\command.js:261:20)
    at new Promise (<anonymous>)
    at Class.validateAndRun (D:\Users\harbmihi\AppData\Roaming\npm\node_modules\@angular\cli\ember-cli\lib\models\command.js:240:12)
    at Promise.resolve.then.then (D:\Users\harbmihi\AppData\Roaming\npm\node_modules\@angular\cli\ember-cli\lib\cli\cli.js:140:24)
    at <anonymous>
2reactions
Matmo10commented, Feb 8, 2018

Still occurs on 1.7.0-rc.0

Angular CLI: 1.7.0-rc.0
Node: 8.6.0
OS: darwin x64
Angular: 6.0.0-beta.1
... common, compiler, compiler-cli, core, forms, http
... language-service, platform-browser, platform-browser-dynamic
... router

@angular/animations: 6.0.0-beta.2
@angular/cdk: 5.0.1
@angular/cli: 1.7.0-rc.0
@angular/material: 5.0.1
@angular-devkit/build-optimizer: 0.3.1
@angular-devkit/core: 0.3.1
@angular-devkit/schematics: 0.3.1
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.0-rc.0
@schematics/angular: 0.3.1
@schematics/package-update: 0.3.1
typescript-collections: 1.2.5
typescript: 2.6.2
webpack: 3.10.0

Really missing this functionality in IntelliJ ._.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 5 : ng build -- prod freezes the app performances and ...
My problem is that when i'm working within dev mode ( ng serve ) , everything is OK , but when running ng...
Read more >
Weird ng build crash -- losing my mind! : r/angular - Reddit
Now any time I run ng serve or ng build, this error appears. I have tried downgrading NPM, reinstalling, clearing the cache and...
Read more >
node server crashes #9314 - Asp.Net Zero Support
Angular Live Development Server is listening on 0.0.0.0:4200, ... start: `gulp buildDev && ng serve --host 0.0.0.0 --port 4200` npm ERR!
Read more >
Introduction to the Angular docs
These Angular docs help you learn and use the Angular framework and development platform, ... Work through a full tutorial to create your...
Read more >
Bug listing with status UNCONFIRMED as at 2022/12/24 17 ...
... Bug:423031 - "games-puzzle/mindless-1.6 crash in generating sealed deck" ... Bug:448644 - "games-arcade/xpilot-ng-4.7.3 - a multi-player 2D spacewar ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found