question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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 issue

Describe 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:

  1. ng new a temp app
  2. 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
    
  3. add NgxChartsModule to AppModule
  4. put <ngx-charts-legend></ngx-charts-legend> in app.component.html
  5. 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:open
  • Created 2 years ago
  • Reactions:37
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

16reactions
maknappcommented, Jan 28, 2022

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:

Hoisted from “@angular-devkit#build-angular#webpack-merge#clone-deep”

The warning should not be ignored, the usage should be removed.

11reactions
jpduckwocommented, Feb 20, 2022

Agreed - usage should be removed if at all possible

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found