We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
After installing Chart.js via NPM (npm install chart.js --save-dev), to then be able to include it in scripts like this as per the documentation:
npm install chart.js --save-dev
var Chart = require('src/chart.js');
After installing with NPM and adding var Chart = require('src/chart.js'); in my script, I get the following error:
Module not found: Error: Can't resolve 'src/chart.js' in '/path/to/my/project/resources/assets/js/components'
Not sure, as "main": "src/chart.js" is in package.json
"main": "src/chart.js"
The text was updated successfully, but these errors were encountered:
I think its suppose to be var Chart = require('chart.js');
var Chart = require('chart.js');
can you give that a try @martinbean and see if that works for you ?
Sorry, something went wrong.
Fixed issue chartjs#3788 — documentation update on requiring Chart.js…
4bad291
… using CommonJS
Documentation update on requiring Chart.js using CommonJS and es6 (ch…
2d29f80
…artjs#3788)
Documentation update on requiring Chart.js using CommonJS and es6 (#3788
696f8d3
)
Docs updated in #3815
a52a79b
No branches or pull requests
Expected Behavior
After installing Chart.js via NPM (
npm install chart.js --save-dev
), to then be able to include it in scripts like this as per the documentation:Current Behavior
After installing with NPM and adding
var Chart = require('src/chart.js');
in my script, I get the following error:Possible Solution
Not sure, as
"main": "src/chart.js"
is in package.jsonSteps to Reproduce (for bugs)
npm install chart.js --save-dev
.var Chart = require('src/chart.js');
to a script as per documentation.Environment
The text was updated successfully, but these errors were encountered: