Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng build --prod should suppress warnings about circular dependencies in ngfactory.js files #11135

Closed
fr0 opened this issue Jun 6, 2018 · 3 comments · Fixed by #13227
Closed
Labels

Comments

@fr0
Copy link

fr0 commented Jun 6, 2018

Bug Report or Feature Request (mark with an x)

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

Area

- [ ] devkit
- [ ] schematics

Versions

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

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.8
@angular-devkit/build-angular     0.6.8
@angular-devkit/build-optimizer   0.6.8
@angular-devkit/core              0.6.8
@angular-devkit/schematics        0.6.8
@angular/cli                      6.0.8
@ngtools/webpack                  6.0.8
@schematics/angular               0.6.8
@schematics/update                0.6.8
rxjs                              6.2.0
typescript                        2.7.2
webpack                           4.8.3

Repro steps

See attached repo. Run yarn install or npm install, then run ng build --prod.

The log given by the failure

WARNING in Circular dependency detected:
src/app/bar.component.ngfactory.js -> src/app/foo.component.ngfactory.js -> src/app/bar.component.ngfactory.js

WARNING in Circular dependency detected:
src/app/foo.component.ngfactory.js -> src/app/bar.component.ngfactory.js -> src/app/foo.component.ngfactory.js

Desired functionality

No warnings should be printed.

Mention any other details that might be useful

Having mutually recursive components is a very useful thing to do. The warnings about circular dependencies in the ngfactory.js files (which are only produced when using AoT) is just noise, and the CircularDependencyPlugin config should filter them out.

angular-cli-test.zip

@filipesilva filipesilva added area: devkit/build-angular type: bug/fix freq1: low Only reported by a handful of users who observe it rarely severity1: confusing labels Jun 7, 2018
@filipesilva
Copy link
Contributor

Yeah I agree. We can probably configure the plugin we use to ignore the factories.

Would you be interested in making a PR? It should be fairly straightforward here https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/common.ts#L151-L155

@fr0
Copy link
Author

fr0 commented Jun 7, 2018

I'll gladly submit a PR! It might be early next week by the time I get to it. Thanks for the response!

ahasall added a commit to ahasall/angular-cli that referenced this issue Dec 19, 2018
ahasall added a commit to ahasall/angular-cli that referenced this issue Dec 19, 2018
mgechev pushed a commit that referenced this issue Dec 19, 2018
mgechev pushed a commit that referenced this issue Dec 19, 2018
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants