Closed frufin closed 1 year ago
same here
Hi @frufin, as vue-chartjs 5 is esm only, have you set your project type to module in package.json ? https://vue-chartjs.org/migration-guides/#esm
@frufin @dotob Hi. I can offer 3 options here:
1) Migrate to ESM, as @apertureless said 2) Configure webpack 3) Soon, Chart.js will be released with restored CommonJS support. We will restore CommonJS support too, so you can wait for the release with it.
Hi @apertureless & @dangreen I suspected this problem...
Unless you have a solution to propose, I think I'll have to downgrade chart.js and vue-chartj while waiting for commonJS support...
I suppose i'll have to downgrade vue-chartj to v4.12 and downgrade charts.js to v3.9 Or does a CDN exist for vue-chartjs v5 ?
Thanks
Seems to work using version 5 from CDN
@frufin Hi. Chart.js v4.1 and vue-chartjs v5.1 were released with restored CommonJS support.
@frufin Hi. Chart.js v4.1 and vue-chartjs v5.1 were released with restored CommonJS support.
Works for me now. Thank you very much!
Would you like to work on a fix?
Current and expected behavior
HI, I'm using vue-cli & Vue 2.7.10 Both vue-chartjs & chart.js successefully installed using Yarn
I get an error trying to import vue-chartjs from a component:
import { Bar } from 'vue-chartjs'
=>
Reproduction
Failed to compile. ./src/components/main/views/server/Status.vue?vue&type=script&lang=js& (./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/main/views/server/Status.vue?vue&type=script&lang=js&) Module not found: Error: Can't resolve 'vue-chartjs' in '/Users/fredericrufin/Sites/webapachekit/src/components/main/views/server'
chart.js version
4.0.1
vue-chartjs version
5.0.1
Possible solution
No response