Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

233
Visualizações
Multiple components match node with tagname app-lobby

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)
over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

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.

over 4 years ago · Santiago Trujillo Relatório

0

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) {}
over 4 years ago · Santiago Trujillo Relatório

0

I had the exact same error saying Error: Multiple components match node with tagname <my-tagname> and I checked way too long that this tag is in fact unique. After reading over this question and all answers for the second time, I found @Eugen's comment to the original question and that finally helped me. So I'm adding this here with a little example in case everyone has this problem in the future. Angular's error message doesn't really help here.

My mistake was that I had injected a service into my component and used it directly in the constructor like so:

constructor(private myService: MyService) {
    this.myService.doSomething()
}

That doesn't work because it introduces a race condition between Angular's dependency injection and me wanting to use the service in the constructor. Inside the constructor, the service is not instantiated yet.

What you want to do is use that service after the constructor has been called, i.e. in Angular's OnInit-hook:

export class MyComponent implements OnInit {

    constructor(private myService: MyService) {}

    ngOnInit(): void {
        this.myService.doSomething();
    }

    // Rest of the component
}
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda