0š
The example code you gave in the beginning: āI paid attention that it doesnāt have module.exports = ā¦ neither export defaultā
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
? factory(require('chart.js'))
: typeof define === 'function' && define.amd ? define(['chart.js'], factory) :
(factory(global.Chart));
}(this, (function (Chart) { 'use strict';
...
})));
Above says:
If on the system this code is running has export as an object and module does exist, do factory(require(āchart.jsā)
ELSE
if define equals function and define.amd exists then define([āchart.jsā], factory)
AND
if none of the above exist just do factory(global.Chart)
Did you do:
ānpm install vue-chartjs chart.js āsaveā
or just
ānpm install vue-chartjs āsaveā
Chart.js is a peer-dependency and needed, the last option will not work.
npm install chartjs āsave will do the trick I think
Source:stackexchange.com