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 '"chart.js"' has no exported member 'SubTitle'. #9383
Comments
I looked into the built file and see the plugin being exported as |
I do see that there isn't a type of |
@LeeLenaleee Thanks for the VUE example. I was able to create an angular one that shows the error I'm seeing. https://codesandbox.io/s/sharp-swanson-r5qpk?file=/src/main.ts |
@LeeLenaleee If I used "registerables" instead of "SubTitle" then everything works fine, but it load all the ChartJS modules. |
As @etimberg suspected its a type error which should be rsolved by his pr |
This is a pure TS error. You can add a TS ignore and it will be fine until a fix is released |
Yes changing it to fixed the problem. Thanks so much for the help! |
Expected Behavior
Using Chart.js v3.4.1 in an angular application, I expect that I can use the new options.plugins.SubTitle feature
import { SubTitle } from 'chart.js'; to then allow
Chart.register(SubTitle);
I should not get an error when trying to use SubTitle.
Current Behavior
I am getting the error Module '"chart.js"' has no exported member 'SubTitle'.
Possible Solution
I suspect either it is not called "SubTitle" or it is not being exported.
Steps to Reproduce
Following the https://www.chartjs.org/docs/next/getting-started/integration.html (Bundlers (Webpack, Rollup, etc.)), try and register the "SubTitle" module.
When using
import { registerables } from 'chart.js';
Chart.register(...registerables);
SubTitle work perfectly, but this will load all plugins which is not ideal.
Context
I am required to load all plugins and not just the ones I need.
Environment
The text was updated successfully, but these errors were encountered: