It is not a direct solution to this problem, but for those who received a similar error, after the Angular 14 upgrade, we had this error due to the use of @angular/material/legacy-dialog
and @angular/material/dialog
together. After ensuring that only one of them was used, it worked properly.