Skip to content

Add circular dependency plugin to Webpack config #6739

Closed

Description

@eppsilon

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [X] feature request

Versions.

@angular/cli: 1.1.2
node: 6.11.0
os: darwin x64
@angular/animations: 4.2.3
@angular/common: 4.2.3
@angular/compiler: 4.2.3
@angular/core: 4.2.3
@angular/forms: 4.2.3
@angular/http: 4.2.3
@angular/platform-browser: 4.2.3
@angular/platform-browser-dynamic: 4.2.3
@angular/platform-server: 4.2.3
@angular/router: 4.2.3
@angular/cli: 1.1.2
@angular/compiler-cli: 4.2.3
@angular/language-service: 4.2.3

Desired functionality.

Circular dependency bugs are easy to introduce and can be hard to detect and troubleshoot. Sometimes everything works fine, but in a few cases I've had module imports show up as undefined at runtime. Last time it happened, it was only in AOT mode, so I didn't catch it initially.

It would be helpful if the CLI included a plugin that warns you if circular dependencies are detected and logs the modules that are part of the cycle.

Mention any other details that might be useful.

I used this plugin and it found several issues in my project.

However, I couldn't configure Webpack to use the plugin without ejecting the config, and I'd rather not have to do that each time I need to debug an issue like this.

Activity

  1. self-assigned this
    on Jun 26, 2017
  2. added
    featureLabel used to distinguish feature request from other issues
    P1Impacts a large percentage of users; if a workaround exists it is partial or overly painful
    on Jun 26, 2017
  3. filipesilva commented on Jun 26, 2017

    @filipesilva
    Contributor

    I'll have a look. I agree it's a difficult to debug issue and that we should add a plugin if it helps and has no unexpected side effects.

  4. added 6 commits that reference this issue on Jun 27, 2017
    66d4e33
    5614a99
    91a1da0
    db0f817
    0830f1b
    0d93406
  5. added a commit that references this issue on Jun 27, 2017
    1f3738b
  6. added 2 commits that reference this issue on Jun 28, 2017
    435917b
    7b677bf
  7. di3orlive commented on Jul 13, 2017

    @di3orlive

    @filipesilva ng build --show-circular-dependencies
    not working yet?

  8. filipesilva commented on Jul 14, 2017

    @filipesilva
    Contributor

    It should be working in @angular/cli@next.

  9. di3orlive commented on Jul 14, 2017

    @di3orlive

    @filipesilva tnx. so its only show some errors in console on build ?

  10. filipesilva commented on Jul 17, 2017

    @filipesilva
    Contributor

    Check #6813 for an example of the output.

  11. di3orlive commented on Jul 17, 2017

    @di3orlive

    @filipesilva cool (: tnx, useful feature

  12. added a commit that references this issue on Apr 23, 2018
    647cbfe
  13. angular-automatic-lock-bot commented on Sep 7, 2019

    @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.

  14. locked and limited conversation to collaborators on Sep 7, 2019
  15. added a commit that references this issue on May 29, 2026
    7957a11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfuleffort1: easy (hours)featureLabel used to distinguish feature request from other issues

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions