19.1 triggers angular import warning: swimlane-ngx-charts.js depends on 'clone-deep'. CommonJS or AMD dependencies can cause optimization bailouts.
See original GitHub issueDescribe the bug
Warning: C:\temp\updatecheck\node_modules\@swimlane\ngx-charts\__ivy_ngcc__\fesm2015\swimlane-ngx-charts.js depends on 'clone-deep'. CommonJS or AMD dependencies can cause optimization bailouts.
in a new angular cli app using ngx-charts 19.1.0
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies To Reproduce Steps to reproduce the behavior:
ng new
a temp app- script (note: npm installs other than ngx-charts here are undocumented dependencies necessary to fix build errors):
cd updatecheck npm i @angular/cdk --save npm i @swimlanes/ngx-charts --save npm i @types/d3 --save-dev
- add
NgxChartsModule
to AppModule - put
<ngx-charts-legend></ngx-charts-legend>
in app.component.html - run
ng serve
Expected behavior
app builds without warnings
ngx-charts version
19.1.0
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:37
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Fix CommonJS or AMD dependencies can cause optimization ...
Warning : my.service.ts depends on 'rxjs/BehaviorSubject'. CommonJS or AMD dependencies can cause optimization bailouts. By importing from ...
Read more >CommonJS or AMD dependencies can cause ... - Highcharts
depends on 'highcharts/highcharts-gantt'. CommonJS or AMD dependencies can cause optimization bailouts. depends on 'highcharts/modules/gantt'.
Read more >Jsonforms uses lodash which causes "optimization bailouts ...
In the logs i've tons of “bailout” warnings caused by jsonforms and its dependencies. How to optimize the import of this external dependencies?...
Read more >WARNING CommonJS or AMD dependencies can cause ...
Resolve WARNING CommonJS or AMD dependencies can cause optimization in build ANGULAR 10.
Read more >swimlane-ngx-charts.js depends on 'clone-deep'. CommonJS ...
19.1 triggers angular import warning : swimlane-ngx-charts.js depends on 'clone-deep'. CommonJS or AMD dependencies can cause optimization bailouts.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The clone-deep package is only used in one spot where is it completely unnecessary. It looks like clone-deep was not even added as a dependency. It is in node_modules only because of:
The warning should not be ignored, the usage should be removed.
Agreed - usage should be removed if at all possible