Pear-Trading / FoodLoop-Web

MIT License
1 stars 0 forks source link

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

Open Rumperuu opened 3 years ago

Rumperuu commented 3 years ago

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

Rumperuu commented 3 years ago

charts.js aim to fix this in v3: https://github.com/chartjs/Chart.js/issues/7550#issuecomment-649830607

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

Proper fix: Wait for v3 of package

akhilreddytaniparthi commented 3 years ago

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

AlcidesA commented 3 years ago

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... https://github.com/valor-software/ng2-charts/issues/1214