Dear Developers,
I've been writing a plugin using YUI-based javascript modules. It's been working in 2.7 and 2.8, but in 2.9 one of the scripts loading external libraries stopped working. The errors I'm getting are listed below:
ReferenceError: c3 is not defined charts.js:18:8
Error: Mismatched anonymous define() module: [object Object]
http://requirejs.org/docs/errors.html#mismatch
I'm getting an error from require.js which was not used by previous Moodle versions and I don't have a clue as to what went wrong here.
Charts.js starts with:
YUI({
groups: {
"c3lib": {
base: M.cfg.wwwroot + '/local/chemplugin/js/',
modules: {
"d3": {
path:"d3.min.js",
},
"c3": {
path:"c3.min.js",
requires: ["d3"],
},
}
}
}
}).use("d3","c3", "io", "json-parse","node","event","attribute","node-event-simulate", function(Y){
var chartbysubstance = c3.generate({
...
Other YUI-based scripts that do not load anything external seem to work fine. D3.js library is loaded here while c3.js apparently is not. If anybody knows what is wrong, please help me fix the issue so that I could update the plugin.