Skip to content

Plugin import and registration. #290

Answered by simonbrunel
dbauszus-glx asked this question in Q&A
Discussion options

You must be logged in to vote

Somehow, there is multiple versions of chart.js imported in your Codepen:

await import("https://cdn.skypack.dev/chart.js") 
// imports [email protected]
await import("https://cdn.skypack.dev/chartjs-plugin-datalabels") 
// imports [email protected]
    // which imports [email protected]

That means the plugin uses classes from a different version of chart.js than the one used to create the chart. And this is why it fails to determine the type of element and uses the fallback positioner, which doesn't work with ArcElement.

It's not a bug in this lib but an issue with the way imports are resolved. I don't know why skypack picks chart.js 3.5.0 instead of 3.5.1 when importing the plu…

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@dbauszus-glx
Comment options

@dbauszus-glx
Comment options

Answer selected by dbauszus-glx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #289 on October 12, 2021 16:55.