NG05104: Root element was not found during bootstrap.


Boostraped components are defined in the bootstrap property of an @NgModule decorator or as the first parameter of boopstrapApplication for standalone components.

This error happens when Angular tries to boostrap one of these components but cannot find its corresponing node in the DOM.

Debugging the error

This issue occurs when the selector mismatches the tag

  selector: 'my-app',
class AppComponent {}
    <app-root></app-root> <!-- Doesn't match the selector -->

Replace the tag with the correct one:

    <my-app></my-app> <!-- OK -->

© 2010–2023 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.