Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

383
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda