Entry point 'xxx' contains deep imports into 'yyy' · Issue #35615 · angular/angular · GitHub
Skip to content

Entry point 'xxx' contains deep imports into 'yyy' #35615

Closed

Description

@onebalaban

🐞 bug report

Is this a regression?

Yes, the previous version in which this bug was not present was: 8.2.14

Description

Multiple warnings like "Entry point 'devextreme-angular/...' contains deep imports into '/node_modules/devextreme/...'. This is probably not a problem, but may cause the compilation of entry points to be out of order." occur when building an Angular v9 project with Ivy enabled.

🔬 Minimal Reproduction

https://github.com/onebalaban/dxangular9
npm install
ng build

🌍 Your Environment


Angular CLI: 9.0.3
Node: 13.9.0
OS: win32 x64

Angular: 9.0.2
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.3
@angular-devkit/build-angular     0.900.3
@angular-devkit/build-optimizer   0.900.3
@angular-devkit/build-webpack     0.900.3
@angular-devkit/core              7.3.9
@angular-devkit/schematics        7.3.9
@angular/cli                      9.0.3
@ngtools/webpack                  9.0.3
@schematics/angular               8.3.20
@schematics/update                0.900.3
rxjs                              6.5.4
typescript                        3.7.5
webpack                           4.41.2

Anything else relevant?
There are two packages in the project. The first one is devextreme-angular. It is created according to Angular library requirements. The second package is devextreme. It is not an Angular library. The thing is that warnings are related to long paths of this second package. We think these warnings are false-positive.

Activity

  1. added
    area: compilerIssues related to `ngc`, Angular's template compiler
    regressionIndicates than the issue relates to something that worked in a previous version
    on Feb 21, 2020
  2. added this to the needsTriage milestone on Feb 21, 2020
  3. added and removed
    regressionIndicates than the issue relates to something that worked in a previous version
    area: compilerIssues related to `ngc`, Angular's template compiler
    on Feb 21, 2020
  4. portothree commented on Feb 23, 2020

    @portothree

    I'm currently with the same problem, did you found a workaround?

  5. evanjmg commented on Feb 23, 2020

    @evanjmg

    +1

  6. petebacondarwin commented on Feb 24, 2020

    @petebacondarwin
    Contributor

    These are only warnings. Given that the devextreme package is not compiled by Angular then, as pointed out in the message: "This is probably not a problem."

    It is not possible for ngcc to know whether the deep imports are going to be problematic or not, so it is reasonable to give the developer this information so that they can make a decision for themselves.

  7. evanjmg commented on Feb 25, 2020

    @evanjmg
  8. petebacondarwin commented on Feb 25, 2020

    @petebacondarwin
    Contributor

    Currently this is not possible, but I will look into a way to add a configuration to ngcc to allow you to ignore deep imports for specific entry-points.

  9. 3 remaining items

  10. added a commit that references this issue on Feb 26, 2020
    c7e1539
  11. portothree commented on Feb 26, 2020

    @portothree
  12. added a commit that references this issue on Feb 27, 2020
    9064f4e
  13. stevethemacguy commented on Feb 28, 2020

    @stevethemacguy

    Steps to silence the warning:

    1. Update to Angular 9.0.4
    2. Create a file named 'ngcc.config.js' at your top-level project folder (see fix(ngcc): allow deep-import warnings to be ignored #35683)
    module.exports = {
      packages: {
        'angular2-text-mask': {
          ignorableDeepImportMatchers: [
            /text-mask-core\//,
          ]
        },
      },
    };
    
    1. Enjoy a peaceful build 😌
  14. kekel87 commented on Feb 28, 2020

    @kekel87

    I'm not sure I understand:

    I have this message on a project with a lib and demo:

    WARNING in Entry point 'ngx-openlayers' contains deep imports into
      '[pwd]/ngx-openlayers/node_modules/ol/View',
      '[pwd]/ngx-openlayers/node_modules/ol/Map',
      '[pwd]/ngx-openlayers/node_modules/ol/layer',
    

    My project architecture is:

    projects/
        ngx-openlayers/  <----- lib with ol in peerDependencies
          ng-package.json
    /src                 <----- demo project
    ngcc.config.js       <----- i put ngcc.config.js here
    
    // ngcc.config.js
    module.exports = {
      packages: {
        'ngx-openlayers': {
          ignorableDeepImportMatchers: [
            /ol\//,
          ]
        },
      },
    };

    I put ngcc.config.js at the root of my project and updated angular but I still have the warnings.
    Also, I don't understand how it will work when the lib is distributed.

  15. petebacondarwin commented on Feb 28, 2020

    @petebacondarwin
    Contributor

    I don't think it works with local libraries - if I remember correctly ngcc.config.js expects packages to be below a node_modules directory.

  16. petebacondarwin commented on Feb 28, 2020

    @petebacondarwin
    Contributor

    But I think you could put the ngcc.config.js directly into the local package folder using a slightly different syntax...

    projects/
        ngx-openlayers/  <----- lib with ol in peerDependencies
          ngcc.config.js       <----- put ngcc.config.js here
          ng-package.json
    /src                 <----- demo project
    
    // ngcc.config.js
    module.exports = {
      ignorableDeepImportMatchers: [/ol\//]
    };
  17. kekel87 commented on Feb 28, 2020

    @kekel87

    I just tried it always does the same thing.
    I put a log in ngcc.config.js and I don't have the impression that it is used.

  18. petebacondarwin commented on Feb 28, 2020

    @petebacondarwin
    Contributor

    Please open a new issue with a reproduction of your scenario, and I can look into it.

  19. Valera1980 commented on Mar 27, 2020

    @Valera1980

    Steps to silence the warning:

    1. Update to Angular 9.0.4
    2. Create a file named 'ngcc.config.js' at your top-level project folder (see fix(ngcc): allow deep-import warnings to be ignored #35683)
    module.exports = {
      packages: {
        'angular2-text-mask': {
          ignorableDeepImportMatchers: [
            /text-mask-core\//,
          ]
        },
      },
    };
    
    1. Enjoy a peaceful build relieved

    Thanks. That advice is helps me

  20. maxisam commented on Apr 9, 2020

    @maxisam
    Contributor

    To me, it kinda works. There were like 3 duplicated warnings. Now I only got 2 duplicated warnings lol.

    update

    I figured out why.

    Because I have paths mapping in tsconfig like lib: ["dist/lib"]. And I haven't rebuild the library with ngcc.config.js yet.

    2 duplicated is because of the duplicated path mappings.

  21. roopeshchinnakampalli commented on Apr 23, 2020

    @roopeshchinnakampalli
    Contributor

    Steps to silence the warning:

    1. Update to Angular 9.0.4
    2. Create a file named 'ngcc.config.js' at your top-level project folder (see fix(ngcc): allow deep-import warnings to be ignored #35683)
    module.exports = {
      packages: {
        'angular2-text-mask': {
          ignorableDeepImportMatchers: [
            /text-mask-core\//,
          ]
        },
      },
    };
    
    1. Enjoy a peaceful build 😌

    This was helpful

  22. angular-automatic-lock-bot commented on May 24, 2020

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  23. locked and limited conversation to collaborators on May 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions