Today I am trying to create component with But I am facing the following error: An unhandled exception occurred: catch clause variable is not an Error instance AssertionError [ERR_ASSERTION]: catch clause variable is not an Error instance at assertIsError Angular. In this Exerror article, We are going to learn about How to reproduce this error and we will discuss All Possible Solutions Lets Get Start with This Article.
How An unhandled exception occurred: catch clause variable is not an Error instance Error Occurs?
I am trying to create component with But I am facing the following error.
An unhandled exception occurred: catch clause variable is not an Error instance AssertionError [ERR_ASSERTION]: catch clause variable is not an Error instance at assertIsError
So here I am writing all the possible solutions that I have tried to resolve this error.
How To Solve An unhandled exception occurred: catch clause variable is not an Error instance Error?
- How To Solve An unhandled exception occurred: catch clause variable is not an Error instance Error?
To solve An unhandled exception occurred: catch clause variable is not an Error instance AssertionError [ERR_ASSERTION]: catch clause variable is not an Error instance at assertIsError error you need to run create command with –module=app.module as parameter just like this: ng g c my-component –module=app.module And now, Your error will be solved.
- An unhandled exception occurred: catch clause variable is not an Error instance
To Solve An unhandled exception occurred: catch clause variable is not an Error instance Error You just need to run ng g c my-component command with –skip-import as parameter and your error will be solved. Just run this command: ng g c my-component –skip-import Or You can run this command: ng g c modules/mymodule/component/testing –skip-import And now, your error must be solved. Thanks.
Solution 1: run command with –skip-import
To Solve An unhandled exception occurred: catch clause variable is not an Error instance Error You just need to run ng g c my-component command with –skip-import as parameter and your error will be solved. Just run this command.
ng g c my-component --skip-import
Or You can run this command.
ng g c modules/mymodule/component/testing --skip-import
And now, your error must be solved. Thanks.
Solution 2: run this command
To solve An unhandled exception occurred: catch clause variable is not an Error instance AssertionError [ERR_ASSERTION]: catch clause variable is not an Error instance at assertIsError error you need to run create command with –module=app.module as parameter just like this.
ng g c my-component --module=app.module
And now, Your error will be solved.
Conclusion
It’s all About this error. I hope We Have solved Your error. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Also, Read
- fatal: detected dubious ownership in repository
- Composer detected issues in your platform: Your Composer dependencies require a PHP version
- Unable to locate file in Vite manifest: resources/css/app.css
- ImportError: cannot import name ‘parse_rule’ from ‘werkzeug.routing’
- How To completely uninstall PHP 7.4 in ubuntu?