Is this even possible? Keep reading conflicting reports on this.
I have a Marionette app, just upgraded to 2.4.4.
If I drop in lodash in place of underscore - using requireJS,
map: {
'*': {
'underscore': 'lodash'
}
},
// 'underscore':'/resource/vendor/backbone.marionette/underscore',
'lodash':'/resource/vendor/lodash/lodash.min',
I get the following error...
Uncaught TypeError: Cannot read property 'vent' of undefined
lodash is loading up ok, just marionette is complaining.
It appears that the context this
on line 466
is undefined
463 _proxyMethods: function() {
464 _.each([ "vent", "commands", "reqres" ], function(system) {
465 _.each(messageSystems[system], function(method) {
466 this[system][method] = proxyMethod(this, system, method);
467 }, this);
468 }, this);
469 }
Any advice?
messageSystems
isundefined
so that line 465 (messageSystems[system]
) is failing? – Lipinskithis
that is undefined. It is trying to resolve...this["vent"]["on"]
– Erastesthis
as the context - but I mocked up the same function above and it works fine – Erastescontext
as the third param in.each
... ` function forEach(collection, iteratee) { return baseEach(collection, toFunction(iteratee)); }` So the context is lost in the above – Erastes