What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Angular’s NG05104 runtime error means it could not find the DOM element for the component it was asked to bootstrap. Check that component’s selector against the root tag in the HTML loaded by your app; the names must match.

What NG05104 means

NG05104 is Angular’s “Root element was not found” runtime error. It occurs during bootstrap when Angular cannot find the node corresponding to the component it is trying to initialize. Angular documents the error in its NG05104 Error Encyclopedia entry; the broader Angular Error Encyclopedia identifies it as a runtime error.

The component Angular initializes is identified by the application’s bootstrap configuration. In an NgModule application, look at the bootstrap property of the @NgModule decorator. In a standalone application, find the component passed as the first argument to bootstrapApplication.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to find and fix the mismatch

  1. Identify the bootstrap target. Find the component listed in the NgModule’s bootstrap property, or the component passed to bootstrapApplication.
  2. Read that component’s selector. Check its selector value; this is the tag Angular looks for in the page.
  3. Inspect the HTML loaded by the application. Find the root element and compare its tag with the selector. Update the HTML tag or selector so they match, then run the app again.

Example: selector and root tag differ

Angular’s documented example uses a component with the selector my-app, while the page contains <app-root></app-root>. Because those names differ, Angular cannot find the expected root element. Change the page to <my-app></my-app> so it matches the selector.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

If the names already match

The mismatch above is the cause shown in Angular’s documentation, not proof that every NG05104 incident has the same cause. Confirm that you checked the selector of the actual bootstrapped component and the HTML document the application loads—not a different component or an unused HTML file. The key question is whether the DOM contains the element corresponding to the component Angular is initializing.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.