Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"export 'default' (imported as 'Chart') was not found in 'chart.js'

Hi im getting this issue and can't quite figure why its saying it. im using vue3 with tailwind.

""export 'default' (imported as 'Chart') was not found in 'chart.js'"

like image 954
Pledge93 Avatar asked Dec 30 '22 14:12

Pledge93


2 Answers

Guess you are trying to import chart.js like this import Chart from 'chart.js', since chart.js v3 chart.js is treeshakable so you will have to import and register all the components you want to use or import and register everything with the auto import like this: import Chart from 'chart.js/auto'

Docs: https://www.chartjs.org/docs/master/getting-started/integration.html#bundlers-webpack-rollup-etc

like image 106
LeeLenalee Avatar answered Jan 05 '23 16:01

LeeLenalee


For me, I just had to downgrade from [email protected] to [email protected]

like image 42
Sølve Tornøe Avatar answered Jan 05 '23 16:01

Sølve Tornøe