Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

380
Vistas
Why is there an error on importing cross dependencies in an angular library?

I am looking for some help for my angular 13 library cross dependency import.

I have library api and library shared. I want to import some models from api-library into the shared library.

Now i am having the following problem. If i want to import these models into the shared library i am getting the following error: Cannot find module '@api-library' or its corresponding type declarations.. But if am building the shared library with the model imports i am getting no error and the build succeed.

public-api.ts from the api library (i am exporting everything in the whole library):

export * from './lib/api/api';
export * from './lib/api.module';
export * from './lib/model/models';

shared library tsconfig.lib.ts:

{
  "extends": "../../tsconfig.json",
  "compilerOptions": {
    "outDir": "../../out-tsc/lib",
    "declaration": true,
    "declarationMap": true,
    "inlineSources": true,
    "types": [],

    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "forceConsistentCasingInFileNames": true,

    "baseUrl": "./",
    "paths": {
      "@api-library": [
        "../../projects/api/src/public-api.ts",
      ],
      "@api-library/*": [
        "../../projects/api/src/lib/*",
      ]
    }
  },
  "exclude": [
    "src/test.ts",
    "**/*.spec.ts"
  ],
}

shared library tsconfig.build.ts:

{
  "extends": "./tsconfig.lib.json",
  "compilerOptions": {
    "declarationMap": false,
    "paths": {
      "@api-library": ["../../dist/api"],
      "@shared": ["../../dist/shared"],
      "@store": ["../../dist/store"]
    }
  },
  "angularCompilerOptions": {
    "compilationMode": "partial"
  }
}
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda