Using libraries from other libraries in angular

Viewed 63

I am trying to bring a set of libraries from angular 6 to angular 11. Those libraries were using each other in a quite complex network of dependencies managed via aliasing in tsconfig.json.

Specifically, I have the main app that uses one of the libraries, that one uses three of the others and so on composing a complex and customizable setup of libraries interconnected and creating a service.

in tsconfg.json:

{
  "compileOnSave": false,
  "compilerOptions": {
    "preserveSymlinks": true,
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2015",
    "module": "es2020",
    "lib": [
      "es2018",
      "dom"
    ],
    "paths": {
      "@ohmap/chcx-about": [
        "dist/chcx-about/chcx-about",
        "dist/chcx-about"
      ],
      "@ohmap/gcx-core": [
        "dist/gcx-core/gcx-core",
        "dist/gcx-core"
      ],
      "@modalnodes/mn-geo": [
        "dist/mn-geo/mn-geo",
        "dist/mn-geo"
      ],
      "@modalnodes/mn-map": [
        "dist/mn-map/mn-map",
        "dist/mn-map"
      ]
   }
}

within the single blocks i get an error that I cannot understand: the module is imported in gcx-core.module.ts, the other library is referenced in package.json (of the using library) and compiled (the /dist/mn-map folder is filled with the right data as per tsconfig.json.) Cannot find module '@modalnodes/mn-geo' or its corresponding type declarations.ts(2307)

I don't understand what I am doing wrong.

0 Answers
Related