Error: Cannot resolve type entity i10.BidiModule to symbol while building angular Lib project Angular 13

36.1k Views Asked by At

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

3

There are 3 best solutions below

1
Minop On

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

0
Matthew Marichiba On

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.

0
Muskan agarwal On

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