chartjs-plugin-crosshair
chartjs-plugin-crosshair copied to clipboard
Module '"chartjs-plugin-crosshair"' has no exported member 'CrosshairPlugin' and Interpolate
Hi I am trying to use plugin with react-chartjs-2 in my typescript project and getting error in title
any solutions
The types are outdated. On the DefinitelyTyped repo they're for version 1.1.1 while this repo is on 1.2.0.
You may either update the types on definitely typed types, or in a .d.ts
file, add this:
declare module 'chartjs-plugin-crosshair';
The types are outdated. On the DefinitelyTyped repo they're for version 1.1.1 while this repo is on 1.2.0. You may either update the types on definitely typed types, or in a
.d.ts
file, add this:declare module 'chartjs-plugin-crosshair';
Thank you very much, I had the same issue and your solution fixed it.
@Daschi1 @jayantbh could you please share exact changes i am still struglling , do i need to create a .d.ts file
I used the plugin with the sveltjs wrapper of chartjs in a svelte typescript project. I copied declare module 'chartjs-plugin-crosshair';
in my vite-env.d.ts
file, but any .d.ts
should work.
Hey @SharpieX, ^ @Daschi1's instructions should work.
Basically create a file anywhere named anything.d.ts
, just needs to be a .d.ts
file and add it there. You could also add the declaration mentioned previously in any existing .d.ts
file.
I personally have a directory/file like libdefs/ambient.d.ts
in my project root where I add all such declarations.
@jayantbh @SharpieX have you guys managed to make this plugin fly with react-chartjs-2? Could you pls share your packages versions? (react-chartjs-2, chartjs, chartjs-plugin-crosshair)