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.

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 NG8003, “Missing Reference Target,” means the compiler cannot find a directive that matches the export name requested by a template reference. Read the missing name in the error, trace where the template uses it, then check whether the directive is available through the relevant imports and whether it declares that exact exportAs name.

What NG8003: Missing Reference Target means

Angular reports NG8003 when it cannot resolve a directive with the export name named in the diagnostic. A missing import for the directive’s dependency or a directive that does not expose the expected exportAs name are common causes. Angular describes NG8003 as the compiler counterpart of runtime error NG0301, “Export Not Found.” See Angular’s NG8003 error reference.

How do I fix Angular NG8003?

  1. Read the export name in the diagnostic. Use that exact string to search for the template reference requesting it and identify the template or module where it appears.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  2. Check the directive’s availability. Confirm that the dependency providing the directive is imported in the relevant Angular context. For NgModule-based code, check the module’s imports; for a standalone component, inspect that component’s imports. The required location depends on how the template is configured.

  3. Verify the expected export name. Check that the directive actually exposes the name requested by the template, typically through its exportAs declaration. If the directive is available but does not expose that name, correct the template reference or the directive declaration to match the intended API.

  4. Restart the development server if you just added an import. Angular advises restarting the server so the change can take effect.

Example: fixing a missing ngForm export

Angular’s example for a missing ngForm export is to import FormsModule from @angular/forms and add it to the NgModule imports array:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import { FormsModule } from '@angular/forms';

This remedy applies to the ngForm case; it is not a general fix for every NG8003 error. For a different missing export, identify the directive that provides that name and import its dependency where the affected template is configured.

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

Why can’t Angular find this directive export?

The diagnostic identifies the export name Angular could not resolve, which helps distinguish two common problems:

Angular’s official NG8003 guidance recommends using the missing export string to trace the relevant template and module. The error alone does not tell you which of these causes applies; the name and location narrow down what to inspect.

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.