Angular-cli: Generating an Angular component with no name should throw proper error message

Created on 12 Jan 2018  路  6Comments  路  Source: angular/angular-cli

Versions

@angular/cli: 1.4.1
node: 8.9.1
os: win32 x64
@angular/animations: 4.4.6                                                                                              @angular/common: 4.4.6                                                                                                  @angular/compiler: 4.4.6
@angular/core: 4.4.6
@angular/forms: 4.4.6
@angular/http: 4.4.6
@angular/platform-browser: 4.4.6
@angular/platform-browser-dynamic: 4.4.6                                                                                @angular/router: 4.4.6
@angular/cli: 1.4.1
@angular/compiler-cli: 4.4.6                                                                                            @angular/language-service: 4.4.6
typescript: 2.3.4 

Repro steps

  • create a new project with the angular-cli

ng new test-sample
cd test-sample

  • try creating any angular component without providing any (proper) name
    ng g component

Observed behavior

Cannot read property 'split' of undefined                                                                      
TypeError: Cannot read property 'split' of undefined
        at Class.run (C:\Users\cran-cg\test-sample\test-sample\node_modules\@angular\cli\commands\generate.js:109:64)               
    at resolve (C:\Users\cran-cg\test-sample\test-sample\node_modules\@angular\cli\ember-cli\lib\models\command.js:273:20)
    at new Promise (<anonymous>)                                                                                  
        at Class.validateAndRun (C:\Users\cran-cg\test-sample\test-sample\node_modules\@angular\cli\ember-cli\lib\models\command.js:251:12)                                                                                         
        at Promise.resolve.then.then (C:\Users\cran-cg\test-sample\test-sample\node_modules\@angular\cli\ember-cli\lib\cli\cli.js:154:24)                                                                                      
        at <anonymous>

Desired behavior

  • A proper,valid error message should have been printed out to the user

Mention any other details that might be useful (optional)

2 (required) broken

Most helpful comment

I would like to work on it.

All 6 comments

I would like to work on it.

Sounds good, if you have questions, please ping me.

Thanks for letting me 馃憤

@Brocco I have asked you for some advise on the PR thread itself, will request you to look at it

Thanks for reporting this issue. This issue is now obsolete due to changes in the recent releases. Please update to the most recent Angular CLI version.

If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

naveedahmed1 picture naveedahmed1  路  3Comments

sysmat picture sysmat  路  3Comments

NCC1701M picture NCC1701M  路  3Comments

rajjejosefsson picture rajjejosefsson  路  3Comments

gotschmarcel picture gotschmarcel  路  3Comments