Gerrit
Gerrit

Reputation: 1

vue-chartjs "Module not found: Error: Package path ./dist/Chart.js is not exported from package"

I'm trying to use vue-chartjs but I'm having issues with the dependent chart.js installation.

Error:

ERROR in ./node_modules/vue-chartjs/dist/index.js 1:0-190 Module not found: Error: Package path ./dist/Chart.js/auto is not exported from package C:\Users...\project\node_modules\chart.js (see exports field in C:\Users...\project\node_modules\chart.js\package.json)

My package.json:

"dependencies": {
  "@vue-flow/core": "^1.41.6",
  "axios": "^1.7.9",
  "chart.js": "^4.4.7",
  "cors": "^2.8.5",
  "eslint-plugin-vue": "9.32.0",
  "pg": "^8.13.1",
  "pg-hstore": "^2.3.4",
  "register-service-worker": "^1.7.2",
  "sequelize": "^6.37.5",
  "vue": "^3.5.13",
  "vue-chart.js": "^0.2.0",
  "vue-chartjs": "^5.3.2",
  "vue-final-modal": "^4.5.5",
  "vue-good-table-next": "^0.2.2",
  "vue-i18n": "10.0.5",
  "vue-router": "4.5.0",
  "vue3-excel-editor": "^1.0.59"
}

Importing in my BarChart.vue component:

import { Bar, mixins } from "vue-chartjs";
import { Chart as ChartJS, Title, Tooltip, Legend, BarElement, CategoryScale, LinearScale } from 'chart.js'

All npm packages are up to date, also tried deleting the cache and using older versions of chart.js.

What could be the issue?

PS: Also does somebody know why there is vue-chartjs and vue-chart.js in my dependencies?

Upvotes: 0

Views: 44

Answers (0)

Related Questions