Dear Piwik-Team,
after upgrading to Piwik 1.12 we had some problems with some of our websites which are using Dojo 1.8.3. After some digging around we found that there (probably) is a bug in Piwik when using the CommonJS-Function "define".
The specification of CommonJS says that the function "define" is defined as:
define(id?, dependencies?, factory);
But in piwik.js it is used in line 3032 as:
if (typeof define === 'function' && define.amd) {
define(['piwik'], [], function () { return Piwik; });
}
So instead of the module-id beeing a String it is an array. In turn the implementation of Dojo of define() chokes.
A simple fix would be to use a String for the module-id like this:
if (typeof define === 'function' && define.amd) {
define('piwik', [], function () { return Piwik; });
}
I think that is the way the CommonJS-Function should be used. See http://wiki.commonjs.org/wiki/Modules/AsynchronousDefinition
By the way: Thanks for the great work!
Tino
after upgrading to Piwik 1.12 we had some problems with some of our websites which are using Dojo 1.8.3. After some digging around we found that there (probably) is a bug in Piwik when using the CommonJS-Function "define".
The specification of CommonJS says that the function "define" is defined as:
define(id?, dependencies?, factory);
But in piwik.js it is used in line 3032 as:
if (typeof define === 'function' && define.amd) {
define(['piwik'], [], function () { return Piwik; });
}
So instead of the module-id beeing a String it is an array. In turn the implementation of Dojo of define() chokes.
A simple fix would be to use a String for the module-id like this:
if (typeof define === 'function' && define.amd) {
define('piwik', [], function () { return Piwik; });
}
I think that is the way the CommonJS-Function should be used. See http://wiki.commonjs.org/wiki/Modules/AsynchronousDefinition
By the way: Thanks for the great work!
Tino