I've been using numeraljs for component development and I've been testing with LockerService on today and I'm getting the following error:
Uncaught TypeError: Cannot read property 'numeral' of undefined throws at /resource/XXXXXXXXXXXXX/numeraljs/numeral.js:855:46
Now even with this error the page is working fine. It is just annoying to have errors on the page and not know how to fix them. The app is hosted in a VisualForce page using Lightning Out:
<apex:includeLightning />
$Lightning.use("c:myApp", function() {
$Lightning.createComponent("c:myComponent",
{},
"lightning",
function(cmp){});
});
In my component I import the script with Lightning require from a static resource:
<ltng:require scripts="{!$Resource.numeraljs + '/numeral.js'}" />
I'm fairly sure it has something to do with window, SecureWindow, and the way numeraljs is initiated