ng-apexcharts icon indicating copy to clipboard operation
ng-apexcharts copied to clipboard

Warning In angular 10

Open yeshwanthmn opened this issue 4 years ago • 13 comments

When I start the angular 10 app I am getting below mentioned warning ng-apexcharts__ivy_ngcc__fesm2015 g-apexcharts.js depends on 'apexcharts'. CommonJS or AMD dependencies can cause optimization bailouts.

yeshwanthmn avatar Aug 21 '20 17:08 yeshwanthmn

This issue can be removed by adding "apexcharts" to the allowedCommonJsDependencies in your angular.json file

"architect": {
        "build": {
             "options": {
                  "allowedCommonJsDependencies":

IsaacSomething avatar Aug 25 '20 08:08 IsaacSomething

@IsaacSomething, this will only suppress the warning and not actually fix the issue causing this warning.

j-a-h-i-r avatar Oct 09 '20 09:10 j-a-h-i-r

That's because this lib is depending on the CommonJS module instead of the ESM (surprise)

I see that they changed the import from the ESM to the min version, and later removed the deep import to get rid of the ivy warning. See #79 @junedchhipa Maybe you could clarify a bit on that decision? I would rather silence the deep import warning, than my bundle size increases.

stefanolsenn avatar Dec 28 '20 10:12 stefanolsenn

@stefanolsenn The ESM module caused issues in all libraries (react/vue/angular) because of the way it was generated. I haven't found a fix for that and hence it was removed.

junedchhipa avatar Dec 28 '20 10:12 junedchhipa

What issues are we talking about here?

stefanolsenn avatar Dec 28 '20 10:12 stefanolsenn

There is a 3rd party library called svg.js being bundled inside. Instead of the main ApexCharts being exposed, SVG was exposed from the ESM module.

junedchhipa avatar Dec 28 '20 10:12 junedchhipa

Any news on this? Seems like the svg.js being exposed is an issue that could be solved. As Angular moves pretty fast, it would be great to not have optimization bailouts in the current versions.

stashaway avatar Apr 26 '21 19:04 stashaway

Any updates on this? apexcharts is 25% of my apps bundle size.

MNorgren avatar Nov 22 '21 18:11 MNorgren

Any update on this? Is this a time-consuming bug to fix?

AmirSavand avatar Jul 24 '22 15:07 AmirSavand

In my case, I was facing the same issue I have added these lines in my angular.json file => "allowedCommonJsDependencies": ["apexcharts"], and it works for me My angular Version 14.0.0 and apex chart version 3.35.3

Screenshot 2022-07-26 135854

muhammadtayab257 avatar Jul 26 '22 09:07 muhammadtayab257

@muhammadtayab257 That's just ignoring the warning.

AmirSavand avatar Jul 26 '22 12:07 AmirSavand

Any update on this issue? I just updated from Angular 13 (everything was ok) to Angular 14 and this warning started to appear.

VitorBarleta avatar Oct 28 '22 16:10 VitorBarleta

Seeing this as well with Angular 16 :/

rtpHarry avatar Dec 03 '23 07:12 rtpHarry