Closed kingyue737 closed 4 months ago
The generated .d.ts
of vue-echarts
shouldn't produce echarts/types/dist/shared
in the first place. And after some investigation we found that there are some type issues in ECharts itself. After discussing this with the maintainers of ECharts we agree that this should be fixed on their side. We don't currently have a schedule for this yet, unfortunately.
Confirmation
How are you introducing Vue-ECharts into your project?
ES Module imports
Versions
Details
Expected:
In fact:
I found that ECharts v5.5.0 does not add files of
./types/dist/
toexports
inpackage.json
like following:End users need to import types from
echarts/types/dist/shared.js
instead ofecharts/types/dist/shared
whenmoduleResolution
isbundler
in tsconfig (recommended by vite, default increate-vue
and will become default in nuxt). Although it doesn't matter if users only use ECharts itself, users of Vue ECharts will meet broken types as Vue ECharts importsecharts/types/dist/shared
instead ofecharts/types/dist/shared.js
in its output:Or should I request it in ECharts Repo?
Reproduction
https://stackblitz.com/edit/vitejs-vite-svx9rd
In the repro,
npm run typecheck
should have printed error because I've set:update-options="{ bug: 'bug' }"
. But the type-check passed becauseupdate-options
isany
here.