Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 of 15 tasks
kaan35 opened this issue Jul 23, 2022 · 3 comments · Fixed by #23645
Closed
1 of 15 tasks

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

kaan35 opened this issue Jul 23, 2022 · 3 comments · Fixed by #23645
Labels
area: angular/cli freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix

Comments

@kaan35
Copy link

kaan35 commented Jul 23, 2022

🐞 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



@damient
Copy link

damient commented Jul 24, 2022

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

@alan-agius4 alan-agius4 added freq1: low Only reported by a handful of users who observe it rarely severity5: regression area: angular/cli type: bug/fix labels Jul 25, 2022
@ReponseDigitale
Copy link

ReponseDigitale commented Jul 25, 2022

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

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

alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jul 27, 2022
Errors thrown in RxJs are not instanceof Error and therefore the check will always fail.

Closes angular#23631
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jul 27, 2022
…rror instance

Errors thrown in RxJs are not instanceof Error and therefore the check will always fail.

Closes angular#23631
alan-agius4 added a commit that referenced this issue Jul 28, 2022
Errors thrown in RxJs are not instanceof Error and therefore the check will always fail.

Closes #23631
alan-agius4 added a commit that referenced this issue Jul 28, 2022
…rror instance

Errors thrown in RxJs are not instanceof Error and therefore the check will always fail.

Closes #23631
alan-agius4 added a commit that referenced this issue Jul 28, 2022
Errors thrown in RxJs are not instanceof Error and therefore the check will always fail.

Closes #23631

(cherry picked from commit 44f9186)
alan-agius4 added a commit that referenced this issue Jul 28, 2022
…rror instance

Errors thrown in RxJs are not instanceof Error and therefore the check will always fail.

Closes #23631

(cherry picked from commit 8fd3e9f)
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: angular/cli freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants