2

I have an angular element (within an nx workspace). when i use it in another angular project I get TypeScript dependency errors.

It seems my elements cannot inherit any dependancies (or use peerDependancies) from its' host node_modules because of these errors.

The screenshot shows the errors caused by adding my angular element to another angular app.

enter image description here../met-libs-nx/dist/libs/core/fesm2015/jomatech-core.mjs:7:0-47 - Error: Module not found: Error: Can't resolve '@angular/fire/database' in '/Users/omar/Sites/met-libs-nx/dist/libs/core/fesm2015' Did you mean 'angular-fire-database.js'? BREAKING CHANGE: The request '@angular/fire/database' failed to resolve only because it was resolved as fully specified (probably because the origin is a '.mjs' file or a '.js' file where the package.json contains '"type": "module"'). The extension in the request is mandatory for it to be fully specified. Add the extension to the request.

I assume i need to build my angular element (module) dependancies differently? What do you need to see?

the internet says updating webpack config is the way to go but how do i do that in an angular env?

package.json

enter image description here

ng-package.json

enter image description here

tsconfig.lib.json

enter image description here

tsconfig.lib.prod.json

enter image description here

Omar
  • 2,726
  • 2
  • 32
  • 65
  • did you fix this problem? @Omar – Dolphin Feb 12 '22 at 12:46
  • @liangqicai im pretty sure that updating my angular project in the host app made the errors go away. With that in mind; building the libs without ivy probably woud be the correct way to solve this. Although i didnt test it – Omar Feb 15 '22 at 15:51

0 Answers0