The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Angular NG1001 means a decorator received an argument that is not an object literal. The documented fix is to put the metadata object directly in the decorator call instead of passing a variable that holds it.
What does Angular NG1001 mean?
NG1001 is Angular’s compiler error named “Argument Not Literal.” Angular’s NG1001 documentation says the decorators @NgModule, @Pipe, @Component, @Directive, and @Injectable accept only object literals as arguments. A variable that evaluates to an object is still a reference, not an object literal written directly in the decorator call.
As an Amazon Associate I earn from qualifying purchases.
How do you fix NG1001?
-
Find the decorator named in the compiler diagnostic.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
Check whether its argument is a variable or another non-literal expression, rather than an object literal.
#1 Best Overall
-
Move the metadata object into the decorator call itself. For example, change
@NgModule(moduleDefinition)to@NgModule({ /* metadata properties */ }), placing the actual metadata properties inside the braces. -
Rebuild the application and review any follow-on compiler diagnostics.
Why does Angular require a literal in a decorator?
Angular says the restriction makes compiler metadata extraction faster. Its documentation describes the stricter requirement as an Ivy change: Ivy compiles decorators by moving expressions into other locations in the class output. The documentation identifies this as a change from View Engine, but does not give a version boundary for when the behavior applies.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsWhich decorators can trigger NG1001?
@NgModule@Pipe@Component@Directive@Injectable
These are the decorators Angular lists as requiring object-literal arguments in its error guidance. The Angular Error Encyclopedia lists NG1001 among compiler errors.
Rank #3
What if the error remains?
Confirm that the decorator argument itself contains the metadata object, rather than a reference to an object defined elsewhere. Then rebuild and read the updated diagnostic; the documented rule does not establish that every non-literal expression behaves identically across all compiler and Angular versions.
Quick Recap
Rank #4
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.




