I had this error in Angular reactive forms, here is how I fixed it.
main.js:1 ERROR TypeError: Cannot read properties of null (reading '_rawValidators')
After some digging, I realized. it must be about formControlName. Make sure you do not have a type made in it.
this.yourForm = this.fb.group({
name: [''],
contact: this.fb.group({
address: ['']
})
})
<form [formGroup]="yourForm">
<input type="text" formControlName="name" />
<div formGroupName="contact">
<input type="text" formControlName="address" />
</div>
</form>