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 NG0403: Bootstrapped NgModule Doesn’t Specify Which Component to Initialize

NG0403 occurs when the NgModule passed to bootstrapModule() has neither a nonempty bootstrap array nor an ngDoBootstrap() hook. Here’s how to choose and verify the right fix.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Angular NG0403 means the NgModule passed to bootstrapModule() has no root component to start and no manual bootstrap hook. For conventional startup, add the intended root component to that module’s nonempty bootstrap array. If the module deliberately controls startup itself, implement ngDoBootstrap() instead.

What causes Angular NG0403?

Angular raises NG0403 when the @NgModule used for application startup has a missing or empty bootstrap property and its class does not implement ngDoBootstrap(). The error is about startup configuration in the bootstrapped module—not a missing template import. Angular’s NG0403 guidance demonstrates both an omitted property and an empty array as error cases.

As an Amazon Associate I earn from qualifying purchases.

In a typical NgModule application, bootstrapModule() receives the module that declares the application’s root component. Angular uses the module’s bootstrap metadata to determine which component to start. See the NgModule API.

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

Fix NG0403 with a root component

For conventional application startup, list the intended root component in the bootstrap array of the exact module passed to bootstrapModule():

@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule],
  bootstrap: [AppComponent],
})
export class AppModule {}

platformBrowser().bootstrapModule(AppModule);

Replace AppComponent and AppModule with the component and module your application actually uses. The component must be a valid bootstrap component for the Angular version and component model in the project. Angular’s NgModules guide says components listed in bootstrap are automatically included in the module’s declarations.

When to use ngDoBootstrap()

Implement ngDoBootstrap() when the module intentionally manages component startup manually rather than relying on a fixed root component in metadata. Angular documents this hook as the alternative to a nonempty bootstrap array for resolving NG0403.

Choose based on the application’s startup design: use the array for conventional, declarative startup; use the hook only when module code is meant to control startup. Don’t add an arbitrary component or empty hook merely to silence the error.

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

Check the module Angular actually starts

  1. Find the call to bootstrapModule(...) in the application entry point and note the exact module passed to it.
  2. Open that module’s @NgModule metadata. Confirm that bootstrap contains the intended root component, or that the module class implements ngDoBootstrap().
  3. If the configuration appears correct but NG0403 persists, check whether you edited the same module that the entry point bootstraps, and whether the running application uses the expected entry point and build.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Does fixing NG0403 require migrating away from NgModules?

No. An existing application that calls bootstrapModule() can address this error by configuring its bootstrapped module with a root component or the manual hook. Migration is a separate architectural decision. Angular recommends bootstrapApplication() instead of bootstrapModule() for new code, while continuing to document NgModules for understanding existing applications; see the NgModules guide.

Angular’s core application reference tests also cover the error when both bootstrap mechanisms are absent and the automatic startup of a component listed in @NgModule.bootstrap.

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.