Angular Material: Error: mat-form-field must contain a MatFormFieldControl
A <mat-form-field> has no Material input inside, or the module that provides matInput/mat-select is not imported.
mat-form-field must contain a MatFormFieldControlError: mat-form-field must contain a MatFormFieldControl.mat-form-field must contain a MatFormFieldControl. Meaning
mat-form-field needs a control registered with it: matInput, mat-select, mat-chip-grid, etc. A plain <input> without matInput, a missing MatInputModule / MatSelectModule, or a control hidden by @if at render time all cause it.
Common causes
MatInputModule/MatSelectModule/MatChipsModulenot imported<input>lacks thematInputattribute- The control is rendered conditionally or inside a child component
- Using
mat-selectwithout importingMatSelectModule - Version mismatch between @angular/material and @angular/cdk
⚡ Quick fix
- Import the Material module for the control
- Add
matInputto the input - Keep the control directly inside the
mat-form-field
Detailed fix by platform
Angular
- Standalone:
imports: [MatFormFieldModule, MatInputModule] - Install matching versions:
ng add @angular/material
Code examples
Control inside the form field
<mat-form-field appearance="outline">
<mat-label>Email</mat-label>
<input matInput formControlName="email" type="email"> <!-- matInput is required -->
<mat-error>Enter a valid email</mat-error>
</mat-form-field>How to diagnose
- Control — Is matInput / mat-select inside?
- Module — Is its module imported?
- Versions — Material and CDK match the core version?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in Angular
- NullInjectorError Angular: NullInjectorError: No provider for X!
- NG0100 Angular: NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked
- NullInjectorError: No provider for HttpClient! Angular: NullInjectorError: No provider for HttpClient! — provideHttpClient() missing
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 15 Oct 2026