Chart.js: Angular 10 issue -> optimization bailouts

Created on 25 Jun 2020  ·  2Comments  ·  Source: chartjs/Chart.js

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

bug

Most helpful comment

In v3 we will be publishing an ES module

All 2 comments

In v3 we will be publishing an ES module

For now, I fixed the issue by adding (whitlisting) below line in angular.json

"architect": {
  "build": {
    ...
    "options": {
      "allowedCommonJsDependencies": ["chart.js"]
    }
  }
}

Reference taken from: Stackoverflow: Angular 10 Upgrade - Fix CommonJS or AMD dependencies can cause optimization bailouts

Was this page helpful?
0 / 5 - 0 ratings