You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the broken chart example, I accidentally used multiple versions of AMCharts.
In the past, this might have prevented you from finding the real problem.
I have fixed this problem and updated the example link in the first post of the thread.
Just in case, I’ll write down here a link to the previous example with importing several versions of AMCharts, so that you can compare the examples if necessary: https://codepen.io/qsppl/pen/KwPPLaa
One of the AMCharts repository contributors (@Pauan) seems to have found the problem:
I noticed that it's not handling cross-file imports properly. The percent.js and Animated.js files are supposed to be importing things from amcharts5.mjs... but they aren't. There's no imports at all.
So it seems to be splitting each file into separate unrelated chunks, instead of sharing a single chunk.
If we go back to the example, everything looks exactly as he said:
Here in the file five imports of different modules of one project are performed:
But it seems that ESM.SH returned not five modules of one project, but five differently builded projects.
Accordingly, all variables exported from modules are their own for each import.
Failing module
Expected
See Donut Chart - Working example
Observed
See Donut Chart - Non-working example(deprecated)See Donut Chart - Non-working example
Additional info
This question has already been raised in the AmCharts repository itself. The AmCharts developers suspect that esm.sh uses its own npm package builder into esm modules and that the AmCharts package was not built correctly.
The text was updated successfully, but these errors were encountered: