Last update July 2, 2023 at 08:00
You are working on an Angular project then you encounter this error snippet: The class AppComponent is listed in the declarations of the NgModule AppModule, but is not a directive, a component, or a pipe….
A more recent version of the solution is available at troubleshooter.tedidev.com
This troubleshooting concerns a type of problem that one can encounter when developing an application with Angular.
Problems of this type often have several solutions, some of which will not match yours. In this article we add our grain of salt by offering you a solution that worked with our project.
Workaround for “The class AppComponent is listed in the declarations of the NgModule AppModule”
The full message of the error that we are going to resolve this presents as such:
The class 'AppComponent' is listed in the declarations of the NgModule 'AppModule', but is not a directive, a component, or a pipe. Either remove it from the NgModule's declarations, or add an appropriate Angular decorator.
The cause in our case of this error is that the html code of the component angular AppComponent is badly written in the html.
To solve it you have to check the opening and closing tags of your html code. If the error persists, stop the program and restart it with the command ”Ng serve“ .
In our case the error came from a component which is badly written in AppComponent.
ON THE SAME TOPIC
- Tux Typing: the educational game that turns learning the keyboard into an adventure!
- Cash register – The essential solution to better manage your business
- Rent or buy your computer? possibility of renting with option to buy
- Become a good programmer: The keys to excel in the different fields of programming!
- The 10 things that annoy PC users the most
- Tizen OS – 12 Things You (Maybe) Didn't Know About This System
- HP All-in-One Desktop PC: The All-in-One Computer Starts Up but the Screen Displays Nothing
- Git linking local repository to remote repository – How to link your local repository to the remote repository to protect your project.
- 8 Examples of Infamous Malware
- Y2MATE – youtube video downloader and converter
- mbind: Operation not permitted – mysql – troubleshooting
- Ubuntu Won't Launch After Installation – 3 Solutions – Troubleshooting
- The 4 rules of simple design according to Kent Beck
- 10 free apps to learn typing without looking
- How to install Mysql in ubuntu 20.04 lts - tutorial
- Bluesky – The decentralized social network backed by former Twitter CEO