Angular Material DatePicker — Error: mat-form-field must contain a MatFormFieldControl

I want add a date picker to select a date range.

App module

MatFormFieldModule,
MatDatepickerModule,
MatInputModule,

Form

<mat-form-field appearance="fill">
  <mat-label>Enter a date range</mat-label>
  <mat-date-range-input [rangePicker]="picker">
    <input matStartDate placeholder="Start date" #arrival>
    <input matEndDate placeholder="End date" #departure>
  </mat-date-range-input>
  <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
  <mat-date-range-picker #picker></mat-date-range-picker>
</mat-form-field>

But I receive the following error:

ERROR Error: mat-form-field must contain a MatFormFieldControl.

Source: Angular Material Quesions