Skip to content

One library can't import another library #10665

@lsa-shanghai

Description

@lsa-shanghai

Versions

Angular CLI: 6.0.0
Node: 10.0.0
OS: darwin x64
Angular: 6.0.0
... animations, cli, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.6.0
@angular-devkit/build-angular      0.6.0
@angular-devkit/build-ng-packagr   0.6.0
@angular-devkit/build-optimizer    0.6.0
@angular-devkit/core               0.6.0
@angular-devkit/schematics         0.6.0
@ngtools/json-schema               1.1.0
@ngtools/webpack                   6.0.0
@schematics/angular                0.6.0
@schematics/update                 0.6.0
ng-packagr                         3.0.0-rc.2
rxjs                               6.1.0
typescript                         2.7.2
webpack                            4.6.0

Repro steps

  • Step 1
    ng generate library model-lib
    ng generate library ui-lib
    ng generate application portal
  • Step 2
    ng build model-lib
  • Step 3
    import { ModelLibModule } from 'model-lib' in portal module
    ng build portal
  • Step 4
    import { ModelLibModule } from 'model-lib' in ui-lib module
    ng build ui-lib

Observed behavior

BUILD ERROR
projects/ui-lib/src/lib/ui-lib.module.ts(3,29): error TS2307: Cannot find module 'model-lib'.

Desired behavior

Library should import other library same as application.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions