Skip to content

LinearScaleBase is not defined - Possible Tree-shaking problem? #391

Answered by RobDM
RobDM asked this question in Q&A
Discussion options

You must be logged in to vote

I'm not sure if this is a good solution, but it's the only one I've been able to find so far.

Instead of using the ESM module:
import ChartDataLabels from 'chartjs-plugin-datalabels'

I'm now using the non-ESM module:
import ChartDataLabels from 'chartjs-plugin-datalabels/dist/chartjs-plugin-datalabels.js'

This seems to avoid the tree-shaking issues I was experiencing, possibly at the expense of not tree-shaking the library at all.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by RobDM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant