The first line of my file looks like this:
define(['plugins/http', 'durandal/app', 'knockout', 'plugins/ajax', 'plugins/formatters'], function (http, app, ko, ajax,formatters) {
Some of my AMD modules load just fine, but some don't, in this example the formatters parameter is undefined.
No errors are shown in the console, and there is a formatters.js file in the same plugins folder with the other plugins that work fine.
How do I debug this? When I put a breakpoint in formatters.js it is being run, so why is the parameter undefined?
I stripped down my formatters js so it has almost nothing in it, just one function, and it still doesn't work:
define(['knockout'], function (ko) {
'use strict';
return {
//convert to number
rawNumber: function (val) {
if (val == null)
return 0;
else
return Number(ko.utils.unwrapObservable(val).toString().replace(/[^\d\.\-]/g, ''));
}
};
});
Is something wrong with my module, or with my durandal config, or what, has this happened to anyone else that modules are just undefined? What can this mean?
Please help. Thanks!