PDA

View Full Version : [INFOREQ] Cannot read property '_incr_' of undefined



mpasumarthi
4 May 2015, 6:33 AM
Hi,

I am trying to build and run my sencha touch 2.4.0 with the new one. What i have done is created a new modern app with sencha cmd (6.0.0.92) and copied all my app files to the new one. copied all the required files. But when i run the app I am getting this error "Cannot read property '_incr_' of undefined". This is happening when the code is registering events on my custom singleton class. My code is not running further because of this. Can some one help me on this.

Below is my existing custom singleton class from ST 2.4.0



Ext.define('AppName.webworkers.WS2PClientWorker', {
singleton: true,
alternateClassName: ['WS2PWorker'],
requires: ['Ext.util.MixedCollection'],
mixins: {
observable: 'Ext.util.Observable'
},
.......
});

Failing on this code

WS2PWorker.on({
ConnectionOpen: { fn: this.onSocialSwarmsClientConnectionOpen, scope: this }
});




Regards,
Manoj

mitchellsimoens
4 May 2015, 10:50 AM
Try using Ext.mixin.Observable instead of Ext.util.Observable. Does that help?

FBNitro
4 May 2015, 12:26 PM
In addition to the other suggestion, you may also need to call the following before registering for the events:
this.mixins.observable.constructor.call(this, config);

I had the same problem moving from Touch2.4.1 to Ext6.

dongryphon
6 May 2015, 4:21 PM
+1 to FBNitro - you should call the Observable constructor to properly initialize the instance.

mpasumarthi
8 May 2015, 10:24 AM
Hi FBNitro and Don,

That suggestion worked Thank you guys. But still need to resolve lots of errors. I will keep posting if I get stuck while moving my 2.4.0 project to ExtJS.

Regards,
Manoj.