the code was running fine on angular version 8.3.4 but when i updated it to the latest version of angular ( 9 ) i got the following error
following is the stack trace
core.js:3866 ERROR Error: Uncaught (in promise): Error: Multiple components match node with tagname app-lobby
Error: Multiple components match node with tagname app-lobby
at throwMultipleComponentError (core.js:5511)
at findDirectiveDefMatches (core.js:8276)
at resolveDirectives (core.js:8080)
at elementStartFirstCreatePass (core.js:14215)
at ɵɵelementStart (core.js:14249)
at Module.ɵɵelement (core.js:14324)
at MainComponent_Template (main.component.html:1)
at executeTemplate (core.js:7562)
at renderView (core.js:7387)
at renderComponent (core.js:8577)
at resolvePromise (zone.js:836)
at resolvePromise (zone.js:795)
at zone.js:897
at ZoneDelegate.invokeTask (zone.js:431)
at Object.onInvokeTask (core.js:27769)
at ZoneDelegate.invokeTask (zone.js:430)
at Zone.runTask (zone.js:198)
at drainMicroTaskQueue (zone.js:611)
at ZoneTask.invokeTask (zone.js:517)
at ZoneTask.invoke (zone.js:502)
Probably you have more than one component with the same selector tag name app-lobby
...
@Component({
selector: 'app-lobby',
...
Please double check to ensure that only one component selector tag name is app-lobby
.
The two answers above about declaring DatePipe
in providers
should be considered. Today I met this problem (Angular 9) when adding an argument private datePipe: DatePipe
in the constructor of my component without declaring DatePipe
in the module's provider
. After adding DatePipe
in providers
, I have no more the problem.
The constructor :
constructor(private authenticationService: AuthenticationService, private datePipe: DatePipe) {}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With