Skip to content

ng generate component - catch clause variable is not an Error instance  #23631

Closed

Description

@kaan35

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Description

Hello

After adding server side rendering I can't create new component with cli command.

A clear and concise description of the problem... -->

🔬 Minimal Reproduction

npm i -g @angular/cli
ng new myapp && cd myapp
ng add @nguniversal/express-engine
ng generate component test

🔥 Exception or Error



An unhandled exception occurred: catch clause variable is not an Error instance
[error] AssertionError [ERR_ASSERTION]: catch clause variable is not an Error instance


🌍 Your Environment



Angular CLI: 14.1.0
Node: 18.6.0 (Unsupported)
Package Manager: npm 8.14.0 
OS: linux x64

Angular: 14.1.0
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1401.0
@angular-devkit/build-angular   14.1.0
@angular-devkit/core            14.1.0
@angular-devkit/schematics      14.1.0
@nguniversal/builders           14.0.3
@nguniversal/express-engine     14.0.3
@schematics/angular             14.1.0
rxjs                            7.5.6
typescript                      4.7.4



Activity

  1. damient commented on Jul 24, 2022

    @damient

    I have the same error with angular 14.1

    EDIT :
    I tried with angular cli 14.0.7 and i have this error :
    More than one module matches. Use the '--skip-import' option to skip importing the component into the closest module or use the module option to specify a module.
    When i use 14.1 again with --module app it working fine

  2. added
    freq1: low
    on Jul 25, 2022
  3. ReponseDigitale commented on Jul 25, 2022

    @ReponseDigitale

    Same behaviour when trying to generate a Pipe ng generate pipe foo.

    And same workaround solution worked fine : ng generate pipe foo --module app

  4. added 2 commits that reference this issue on Jul 27, 2022
    b277a1a
    0df359a
  5. added 4 commits that reference this issue on Jul 28, 2022
    44f9186
    8fd3e9f
    4ee825b
    eed54b3
  6. angular-automatic-lock-bot commented on Aug 28, 2022

    @angular-automatic-lock-bot

    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.

  7. locked and limited conversation to collaborators on Aug 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: @angular/clifreq1: lowseverity5: regressiontype: bug/fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions