Angular’s NG6100 warning is about id: module.id in @NgModule metadata. Angular calls it a common anti-pattern: the compiler ignores the declaration and warns because the NgModule ID is useful only when code deliberately looks up that module with getNgModuleById(). If your project does not use that lookup, remove the id property; you do not need to migrate the app away from NgModules to fix NG6100.
What NG6100 means
This warning identifies an NgModule configured like this:
As an Amazon Associate I earn from qualifying purchases.
@NgModule({
id: module.id,
// other metadata
})
export class FeatureModule {}
The id field is not a general-purpose module identifier. Angular provides it so a module can be retrieved by ID using getNgModuleById(). Angular describes the common module.id pattern as an anti-pattern, says the compiler ignores the declaration, and warns that it is likely not useful in the code: Angular’s NG6100 error entry.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →How to fix the warning
-
Search the project for
getNgModuleById()and check whether the module is intentionally registered for a specific lookup or bundling arrangement.#1 Best Overall
-
If the lookup is not used, remove only
id: module.idfrom the NgModule metadata:@NgModule({ // other metadata }) export class FeatureModule {} -
Rebuild or run the project’s usual Angular checks and confirm NG6100 is gone.
There is no need to change unrelated NgModule metadata or undertake a wholesale framework migration just to address this warning.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11When an NgModule ID is actually useful
Keep an ID only when application code genuinely needs to retrieve an NgModule through getNgModuleById(). Angular describes this as rare, with use cases mainly involving bundling arrangements where a lazily loaded module must be accessed without a direct reference. The NgModule API reference documents the lookup API.
Rank #3
In that case, use a meaningful, stable string ID that matches the lookup design rather than assuming CommonJS module.id is suitable. Angular notes that this CommonJS value is usually opaque to consumers. Supplying an NgModule ID also makes the module non-tree-shakable and can affect bundle size; Angular does not publish a numerical size impact in its NG6100 guidance.
For ordinary lazy loading, use a direct import
Most code that needs to load a module dynamically should use ES dynamic import(), for example import('./path/to/module'). The caller receives a direct reference, avoiding the global registration side effect associated with looking up a module by ID. Angular recommends this approach for most code in its NG6100 guidance.
Rank #4
Why this pattern is often present
The NgModule id is sometimes confused with older component metadata. Earlier Angular versions sometimes used moduleId: module.id in @Component; that is a separate setting with a different history and purpose. An Angular framework issue opened on December 14, 2022, explains that Ivy does not respect @Component.moduleId for resource resolution as View Engine did: Angular issue #48490.
That historical component field is not a reason to retain id: module.id on an NgModule. For current Angular guidance on working with existing modules and the framework’s direction for new code, see the NgModules guide.
Quick Recap
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.




