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
which means that when a CommonJS require loads chart.js, it will get dist/chart.cjs whereas an ES module willl get dist/chart.js instead.
That is, chart.js is badly defined and defines different versions for ESM and CJS and this is a bug in the package itself.
As for the interop issue - the chart.cjs module is actually correct, it's reading .defaults.global.plugins but in the latest version of ChartJS this is .defaults.plugins that is the global property of the defaults object no longer exists in the latest version. So the plugin is not compatible with this newer version of ChartJS as it needs to be updated to reference the .defaults.plugins object instead. This is not a JSPM interop issue either.
So both issues are package issues here unfortunately, and not JSPM issues.
For the first I would suggest to PR chart.js to avoid the dual package hazard by defining one main module.
And for the second I would suggest to use an updated version of the plugin that references .defaults.plugins.
I am not sure if this is to be expected, but I am seeing this behaviour in the following reproduction.
Behaviour
https://ga.jspm.io/npm:[email protected]/dist/chart.cjs
(see.cjs
extension) is added to the scopesExpected
https://ga.jspm.io/npm:[email protected]/dist/chart.js
is added to the scopes insteadThe text was updated successfully, but these errors were encountered: