October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk2 min

Angular NG8023: How to Fix “Multiple Components Match Same Element”

NG8023 means multiple components in Angular’s compilation scope match one template element. Trace the element’s selectors, including imported components, and make the intended match unique.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Angular’s NG8023 compiler error means that two or more components available in a template’s compilation scope match the same element. Find the element named in the diagnostic, identify every component selector that matches it—including selectors from imported libraries—and make the intended component the only match.

What NG8023 means

Angular documents the error as: “Two or more components in the compilation scope match the same element in a template.” A component selector tells Angular which template elements a component applies to. When multiple components match one element, Angular cannot choose a single component, so compilation fails. NG8023 is a compiler error, listed in Angular’s error encyclopedia.

As an Amazon Associate I earn from qualifying purchases.

For example, if two components use the selector comp and a template contains <comp></comp>, both components match that element. Angular’s component acceptance tests illustrate the corresponding runtime collision as NG0300.

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

How to find the conflicting components

  1. Start with the diagnostic. Note the element Angular identifies; that is where the competing matches occur.
  2. Search component declarations. Find the relevant @Component declarations and compare their selector values with the element. Check selectors that match either the element name or its attributes.
  3. Check the full compilation scope. Include components made available through imports, not just components defined in your application. An imported component library can supply the second match.

How to resolve NG8023

Change the colliding selectors so the intended component is the unique match for that element. Angular’s documented example has two attribute-selector components, [stroked-button] and [raised-button], both applied to the same <button>. When both components are in the compilation scope, the element matches both and Angular reports NG8023. Review the selectors and the template usage together, then make the selector match unambiguous.

There is no universal naming convention prescribed in Angular’s guidance; the requirement is that selectors be sufficiently unique. Avoid changing unrelated template code before confirming which declarations actually match the named element.

How NG8023 differs from NG0300

NG8023 is detected by the compiler while building the application. NG0300 is Angular’s runtime counterpart for a selector collision. The distinction is when the ambiguity is reported; both concern multiple components matching the same element.

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

Official Angular guidance

Angular’s detailed NG8023 explanation is published on the official Japanese-localized Angular site and describes the error and debugging approach. The current English-language error index lists NG8023 among compiler errors.

Free tools Windows power users keep installed

One-click scans. No signup required.

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

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.