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

4 May 2015, 6:33 AM

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 ( 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

ConnectionOpen: { fn: this.onSocialSwarmsClientConnectionOpen, scope: this }


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

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.

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

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.