Angular library project build fails in multi-project workspace – cannot find namespace

I have the following Angular multi-project file structure:


The shared-lib project and the web-app project are referencing viewmodels from the application root folder. I can build the web-app project, but not the shared-lib project. I get the following error:

EROR: …component.ts:12:27 – error TS2503: Cannot find namespace ‘Common’.

The typescript configuration for both projects is the same:


  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "module": "esnext",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    //"downlevelIteration": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2015",
    "typeRoots": [
    "lib": [
    "paths": {
      "shared": [
  "angularCompilerOptions": {
    "fullTemplateTypeCheck": true,
    "strictInjectionParameters": true

shared-lib/tsconfig.lib.json and web-app/tsconfig.lib.json

  "extends": "../../tsconfig.json",
  "compilerOptions": {
    "outDir": "../../out-tsc/lib",
    "types": []
  "include": [

Source: Angular Questions

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.