Skip to content

ng build won't break on circular dependencies #20698

@martibenn

Description

@martibenn

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

At least in Angular 6, build would break on circular dependencies

Description

I'm using 11.2.5 CLI and I would like my builds to fail whenever a circular dependency is detected in the build.
Currently, there's just a warning and all goes well.
Context : The aim is to have a circular dependencies detector on a CI

I know there's a showCircularDependencies key in the angular.json file, but it skips the circular dependencies detection

🔬 Minimal Reproduction

  • Add a circular dependency
  • Start a simple ng build
  • You'll see messages like this but the ng build won't fail :
    WARNING in Circular dependency detected: src\app....\some-file.ts
    -> src\app....\some-other-file.ts

🔥 Exception or Error

No error, just a warning, that's the point of the issue 😃

🌍 Your Environment


Angular CLI: 11.2.5
Node: 14.16.1
OS: win32 x64

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

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1102.5
@angular-devkit/build-angular   0.1102.5
@angular-devkit/core            11.2.5
@angular-devkit/schematics      11.2.5
@angular/cdk                    11.2.5
@angular/cli                    11.2.5
@angular/material               11.2.5
@schematics/angular             11.2.5
@schematics/update              0.1102.5
rxjs                            6.6.6
typescript                      4.0.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions