vue-chart-3: Build errors with vite

Installing (and importing) this package on a clean vue-vite project with typescript causes build errors

Cannot find module 'vue/types/options' or its corresponding type declarations
Cannot find name 'Vue'.
Cannot find module '@vue/composition-api' or its corresponding type declarations.

Relevant dependencies:

{
  "scripts": {
    "build": "vue-tsc --noEmit && vite build",
  },
  "dependencies": {
    "chart.js": "^3.6.0",
    "vue": "^3.2.16",
    "vue-chart-3": "^0.5.10"
  },
  "devDependencies": {
    "@vitejs/plugin-vue": "^1.9.3",
    "typescript": "^4.4.3",
    "vite": "^2.6.4",
    "vue-tsc": "^0.3.0"
  }
}

Minimal reproduction repo - https://github.com/JasonMan34/vite-vue-chart-3-bug

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

Works fine now, thanks for the support!