Problem statement:
Angular flex-layout compilation problem when adding angular flex layout to an angular ~13.3.x project as import to the app.module.ts
Steps to reproduce:
- Create new angular project (with angular version ~13.3.x)
ng new <projectname> - Add flex layout dependency
npm install --save @angular/[email protected] - Serve project
ng s(no issues) - Add import to flex layout module within the
app.module.tsfile:
import { FlexLayoutModule } from '@angular/flex-layout';
- Compilation fails with:
Error: node_modules/@angular/cdk/bidi/index.d.ts:37:18 - error TS2314: Generic type 'ɵɵDirectiveDeclaration' requires 6 type argument(s).
37 static ɵdir: i0.ɵɵDirectiveDeclaration<Dir, "[dir]", ["dir"], { "dir": "dir"; }, { "change": "dirChange"; }, never, never, false>;
Question:
How can I fix this?
I had a similar error just trying to get Angular Material to work on a new project. Make sure the following packages are up-to-date, it worked for me:
Typescript Angular/Material Graphql
Also, I reverted back to angular/cdk version 13.0 (I was previously using 14)
I'm not sure exactly which one fixed the issue, but installing and updating all of them did the trick.