Error AtlasError Documentation and Resolution

Property has no initializer and is not definitely assigned in the constructor

Property '{0}' has no initializer and is not definitely assigned in the constructor.

TypeScript found a class property that is declared as required but is not initialized at declaration time or guaranteed to be assigned in the constructor.

TS2564build
Property '{0}' has no initializer and is not definitely assigned in the constructor.
  • A required class property is declared without a default value.
  • The constructor does not assign the property on every control path.
  • strictPropertyInitialization is enabled and the current class design does not satisfy it.
  1. Initialize the property where it is declared or assign it in the constructor.
  2. Mark the property optional only if the design allows it to be absent.
  3. Use a definite assignment assertion only when the property is guaranteed to be assigned before use.
TSConfig Reference: strictPropertyInitialization
TS2564 Property has no initializer and is not definitely assigned: causes and fixes | Error Atlas