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

‘ng2-charts.js depends on 'chart.js'. CommonJS or AMD dependencies can cause optimization bailouts.’ #119

Open
Rumperuu opened this issue Nov 1, 2020 · 3 comments · May be fixed by #124

Comments

@Rumperuu
Copy link
Contributor

Rumperuu commented Nov 1, 2020

Full Warning

WARNING in [...]node_modules/ng2-charts/ivy_ngcc/fesm2015/ng2-charts.js depends on 'chart.js'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Steps to Replicate

  • Run command npm start
@Rumperuu Rumperuu added this to the Beta Release milestone Nov 1, 2020
@Rumperuu Rumperuu added this to To do in LocalSpend Web App. via automation Nov 1, 2020
@Rumperuu
Copy link
Contributor Author

Rumperuu commented Nov 1, 2020

charts.js aim to fix this in v3: chartjs/Chart.js#7550 (comment)

Temporary fix: Add charts.js to the list of allowedCommonJsDependencies in angular.json (PR #118)

Proper fix: Wait for v3 of package

@Rumperuu Rumperuu mentioned this issue Nov 1, 2020
@Rumperuu Rumperuu linked a pull request Nov 1, 2020 that will close this issue
@Rumperuu Rumperuu linked a pull request Dec 10, 2020 that will close this issue
@akhilreddytaniparthi
Copy link

add in angular.json
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"allowedCommonJsDependencies": ["chart.js"],

@AlcidesA
Copy link

AlcidesA commented Apr 13, 2021

Chart.js 3.0 is released 😃

But the ng2-charts package isn't working with this version yet, looks like they are working on this...
valor-software/ng2-charts#1214

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
3 participants