Cookies concent notice

This site uses cookies from Google to deliver its services and to analyze traffic.
Learn more
Skip to main content
This site is no longer updated.Head to Angular.devHome
/

This is the archived documentation for Angular v17. Please visit angular.dev to see this page for the current version of Angular.

NG05104: Root element was not found during bootstrap.

Description

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

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


Debugging the error

This issue occurs when the selector mismatches the tag

      
      @Component({
  selector: 'my-app',
  ...
})
class AppComponent {}
    
      
      <html>
    <app-root></app-root> <!-- Doesn't match the selector -->
</html>
    

Replace the tag with the correct one:

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