apexcharts / vue3-apexcharts

📊 Vue-3 component for ApexCharts
MIT License
314 stars 35 forks source link

Error in Typescript Types #95

Closed arlobelshee closed 8 months ago

arlobelshee commented 9 months ago

Importing charts in modern Typescript (5.x +, node 16, using default bundler) results in a types not found error. Specifically:

error TS7016: Could not find a declaration file for module 'vue3-apexcharts'. '.../dist/vue3-apexcharts.js' implicitly has an 'any' type. There are types at '.../vue3-apexcharts/typings/vue-apexcharts.d.ts', but this result could not be resolved when respecting package.json "exports". The 'vue3-apexcharts' library may need to update its package.json or typings.

You can use https://arethetypeswrong.github.io/?p=vue3-apexcharts to verify errors & see how TS if viewing the lib. See also https://github.com/microsoft/TypeScript/issues/52363 for a discussion of the issue within the TypeScript team.

Desired fix: please set the correct explicit typings, at least for when using JS modules (since that's what I use...).

jashaj commented 9 months ago

This worked fine in 1.4.4 but broke after updating to 1.5.2.

t0byman commented 9 months ago

Would like to see this fixed

wcheek commented 9 months ago

Seeing this as well. Breaking my builds!

dcrystalj commented 9 months ago

I have solved this by adding "noImplicitAny": false, to tsconfig.vitest.json

MBurchard commented 9 months ago

I have solved this by adding "noImplicitAny": false, to tsconfig.vitest.json

Which leads to bad code quality and should not be done. I just tried it and does not fix it for me

It worked with 1.4.4. It was broken since 1.5.0. Is there a chance to get that fixed?

Indekkusu545 commented 8 months ago

When using package.json "exports" and "import" / "types" have different paths, explicit "types" condition is needed. Ref: packagejson-exports

goodwin17 commented 8 months ago

Could you please release the fixed version? The current version of the package does not include merged changes.

sebj54 commented 6 months ago

@junedchhipa bump

oceangravity commented 6 months ago

👀