Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module '"chartjs-plugin-crosshair"' has no exported member 'CrosshairPlugin' and Interpolate #109

Open
SharpieX opened this issue Aug 24, 2022 · 6 comments

Comments

@SharpieX
Copy link

Hi I am trying to use plugin with react-chartjs-2 in my typescript project and getting error in title

any solutions

@jayantbh
Copy link

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';

@Daschi1
Copy link

Daschi1 commented Oct 11, 2022

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.

@SharpieX
Copy link
Author

SharpieX commented Oct 11, 2022

@Daschi1 @jayantbh could you please share exact changes i am still struglling , do i need to create a .d.ts file

@Daschi1
Copy link

Daschi1 commented Oct 12, 2022

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.

@jayantbh
Copy link

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.

@sarates
Copy link

sarates commented Jan 20, 2023

@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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants