question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem with typescript

See original GitHub issue
node_modules/vue3-apexcharts/typings/vue-apexcharts.d.ts:2:30 - error TS2307: Cannot find module 'vue/types/plugin' or its corresponding type declarations.

2 import { PluginObject } from 'vue/types/plugin';
                               ~~~~~~~~~~~~~~~~~~

node_modules/vue3-apexcharts/typings/vue-apexcharts.d.ts:5:42 - error TS2709: Cannot use namespace 'Vue' as a type.

5 interface VueApexChartsComponent extends Vue {
                                           ~~~

node_modules/vue3-apexcharts/typings/vue-apexcharts.d.ts:36:59 - error TS2709: Cannot use namespace 'Vue' as a type.

36 declare const VueApexCharts: Component & ComponentOptions<Vue> & PluginObject<any>;
            

Thanks for the great project! Unfortunately I’ve been unable to use it due to this error. Any recommendations?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
IlCallocommented, May 3, 2021

Some errors into TS typings I see there:

https://github.com/apexcharts/vue3-apexcharts/blob/883b047c35891008913abb3fa6f513259ed41b64/typings/vue-apexcharts.d.ts#L2 Should be import { Plugin } from "vue". Notice Plugin is a replacement for both old PluginFunction and PluginObject and that it doesn’t have a generic parameter anymore.


https://github.com/apexcharts/vue3-apexcharts/blob/883b047c35891008913abb3fa6f513259ed41b64/typings/vue-apexcharts.d.ts#L1 https://github.com/apexcharts/vue3-apexcharts/blob/883b047c35891008913abb3fa6f513259ed41b64/typings/vue-apexcharts.d.ts#L36 https://github.com/apexcharts/vue3-apexcharts/blob/883b047c35891008913abb3fa6f513259ed41b64/typings/vue-apexcharts.d.ts#L5

Vue namespace isn’t exported as an interface anymore and cannot be used as such. AFAIK interface VueApexChartsComponent extends ComponentPublicInstance should be used instead.


https://github.com/apexcharts/vue3-apexcharts/blob/883b047c35891008913abb3fa6f513259ed41b64/typings/vue-apexcharts.d.ts#L40

The method to augment Vue instance with custom properties changes, you should now use

declare module '@vue/runtime-core' {
  interface ComponentCustomProperties {
    $apexcharts: typeof ApexCharts;
  }
}
0reactions
junedchhipacommented, May 4, 2021

Hey, I checked your PR. addText is no longer relevant. setLocale is still there (not documented currently though)

Read more comments on GitHub >

github_iconTop Results From Across the Web

The problem with Typescript - zackoverflow.dev
The primary problem is tsc is slow. Deno has addressed this as the TSC bottleneck, and it's a result of the fact that...
Read more >
The Trouble with TypeScript - DEV Community ‍ ‍
TypeScript doesn't improve productivity or readability. It doesn't particularly improve on modern JavaScript feature set. If anything it ...
Read more >
Playground Example - Errors - TypeScript
By default TypeScript doesn't provide error messaging inside JavaScript. Instead the tooling is focused on providing rich support for editors.
Read more >
7 really good reasons not to use TypeScript - everyday.codes
It does not solve the problem : JavaScript does indeed have many problems. TypeScript solves a great many of them through excellent tooling....
Read more >
Issues · microsoft/TypeScript - GitHub
TypeScript is a superset of JavaScript that compiles to clean JavaScript output. - Issues · microsoft/TypeScript.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found