6

I am facing Error: Cannot resolve type entity i10.BidiModule to symbol while building angular Lib project. There are 2 other lib projects which are building fine. This new lib project works well without flex layout and material. But when I use flex layout or material in this project I got below error. I have search a lot. There is solution like including "preserveSymlinks": true in tsconfig.lib.json. Unfortunately its not working for me. Any help on this will be welcome.

enter image description here

Uali
  • 172
  • 1
  • 3
  • 10
  • I had a similar issue, check if npm legacy-peer-deps config is set to true.(run this to check the config: npm config ls -l ) If it is true, than run this: npm config set legacy-peer-deps false and remove packaga-lock.json and run npm install – trkaplan Dec 12 '22 at 14:22

3 Answers3

16

I ran into this very same issue today. I had a library project for Angular 13 and after adding the @angular/flex-layout as a dependency, I could no longer build the library with the exact same error as you.

I managed to fix the problem by adding @angular/cdk as a dependency to my library. I found this information on the flex layout github page, where they install both of these libraries in the "Getting Started" section.

I did not change any other configuration files.

npm install @angular/cdk --save

Elia Weiss
  • 8,324
  • 13
  • 70
  • 110
Minop
  • 386
  • 4
  • 13
  • 1
    Thank u worked for me! Tho had to install the version of @angular/cdk that coincided with the Angular version I was using – brando Jun 24 '22 at 15:40
3

My team ran into this when adding SyncFusion modules to some of our shared projects, which we have structured in a monorepo. After much head scratching and failing with the @angular/cdk & preserveSymlinks solutions out there, I figured out a tweak to my tsconfig.json that made it work for me:

    "paths": {
        "@syncfusion/*": [
            "./node_modules/@syncfusion/*"
        ],
    },

For whatever reason, Typescript sometimes gets confused about where to find certain packages in our environment. Our tsconfig paths section actually has a grab-bag of items in there to smooth things out. Sigh.

Matthew Marichiba
  • 1,942
  • 1
  • 23
  • 24
1

Try "npm ls" it will show conflicting dependencies, resolve those. It worked for me.