I'm having a really weird problem with Angular 9.
Expected behaviour:
a component declared in a module that imports MatDividerModule can use <mat-divider></mat-divider> in its template.
Actual behaviour: The component "compilation" fails with error:
ERROR in component/component.component.html:2:1 - error NG8001: 'mat-divider' is not a known element: 1. If 'mat-divider' is an Angular component, then verify that it is part of this module. 2. If 'mat-divider' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
Keep in mind that the module that declares this component has the MatDividerModule imported:
@NgModule({
declarations: [ComponentComponent],
imports: [
CommonModule,
MatDividerModule,
],
exports: [ComponentComponent]
})
export class MyModule { }
Additional info: I'm using a lot of the material components in other places in my project and it's working fine. I tried importing everything in my module that the other modules imported, but it still failed with the same error.