Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

372
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!