-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Documentation for using ChartJS plugins with different module loaders #4160
Comments
I think the plugin still works because we always export the Both the package.json |
Yes, When trying with draggable, for some reason the build system looks for its dependencies in my app root instead of inside node_modules;
This is using Aurelia CLI's build system so it may be because of that, but I haven't faced this issue before and I use plenty of node modules. Edit: I'm able to get the build to work by changing the plugin's |
That's confusing. I'm kinda surprised that just changing the main file works. 😕 I can see how it would cause the console errors though since the built version of the plugin will have no Is it possible to share the code from your project (or a similar sample) so that I can have a look at how the build is working? |
I think it would be easier to try with a completely new Aurelia CLI project;
If you replace the deferred plugin with annotations or draggable you won't even be able to run |
Should be covered by https://www.chartjs.org/docs/master/getting-started/integration. I am currently using v3.0.0-beta.3 in a react app without trouble. |
I've been using ChartJS in my ES6 (Aurelia) project for a few days, and today I wanted to install my first plugin.
I
npm install
edchartjs-plugin-deferred
andimport
it in my project but for some reason I get errors in the console (the plugin still works however, which is a little puzzling):Uncaught TypeError: Cannot read property 'helpers' of undefined
(The code which throws the error is just
var helpers = Chart.helpers
).I figured the Deferred plugin wasn't built with module loaders in mind so I tried with another plugin (Annotation and Draggable).
With those added to my package.json and build file the entire build fails completely.
Is there any documentation on how to include ChartJS and plugins using different loaders? Importing ChartJS itself works just fine (with
import Chart from 'chart.js'
) but nothing else can even be added to the build it seems...The text was updated successfully, but these errors were encountered: