View Full Version : [FIXED] Modern Mobile mode - Uncaught TypeError: Cannot read property '_incr_' of undefined

16 Jul 2015, 7:14 AM
Hi Support,

Please take a look this senario:

Extjs version:

Cmd version:

>sencha --sdk ext generate app test D:\LoriStore\graisWS\badmintonClubHelper\src\main\webapp\test

1, Create Extjs app via Sencha Cmd
2, Run on tomcat.
3, Try to visit default index.html by mobile device or chrome developer toolbar mobile simulation.
4, Got below error.


16 Jul 2015, 7:23 AM
Uncaught TypeError: Cannot read property '_incr_' of undefined

privates.doAddListener @ ext-modern-all-debug.js?_dc=1437058829928:13238

Ext.Base.Base.addMembers.callParent @ ext-modern-all-debug.js?_dc=1437058829928:7578

Ext.define.privates.doAddListener @ ext-modern-all-debug.js?_dc=1437058829928:26384

Ext.Base.Base.addMembers.callParent @ ext-modern-all-debug.js?_dc=1437058829928:7578

Ext.define.privates.doAddListener @ ext-modern-all-debug.js?_dc=1437058829928:47105

Ext.Base.Base.addMembers.callParent @ ext-modern-all-debug.js?_dc=1437058829928:7578

Ext.define.privates.doAddListener @ ext-modern-all-debug.js?_dc=1437058829928:51852

addListener @ ext-modern-all-debug.js?_dc=1437058829928:12939

Ext.Base.Ext.apply.createAlias.aliasOneMember.(anonymous function) @ ext-modern-all-

Ext.define.constructor @ ext-modern-all-debug.js?_dc=1437058829928:52049

constructor @ ext-modern-all-debug.js?_dc=1437058829928:7871

(anonymous function) @ VM987:1Ext.ClassManager.Ext.apply.create @ ext-modern-all-

Ext.define.setup @ ext-modern-all-debug.js?_dc=1437058829928:52345

(anonymous function) @ ext-modern-all-debug.js?_dc=1437058829928:42811

Ext.env.Ready.invoke @ ext-modern-all-debug.js?_dc=1437058829928:10878

Ext.env.Ready.doInvokeAll @ ext-modern-all-debug.js?_dc=1437058829928:10918

Ext.env.Ready.invokeAll @ ext-modern-all-debug.js?_dc=1437058829928:10887

Ext.env.Ready.unblock @ ext-modern-all-debug.js?_dc=1437058829928:10999

Ext.apply.triggerReady @ ext-modern-all-debug.js?_dc=1437058829928:11514

Ext.apply.checkReady @ ext-modern-all-debug.js?_dc=1437058829928:11618

Ext.apply.onLoadSuccess @ ext-modern-all-debug.js?_dc=1437058829928:11433

Ext.Boot.Ext.Boot.Request.notify @ bootstrap.js:932

Ext.Boot.Ext.Boot.Request.processLoadedEntries @ bootstrap.js:911

Ext.Boot.Ext.Boot.Entry.notifyRequests @ bootstrap.js:1372

Ext.Boot.Ext.Boot.Entry.loadElement.complete @ bootstrap.js:1219

(anonymous function) @ bootstrap.js:1225

Gary Schlosberg
16 Jul 2015, 10:19 AM
What is in your app? To eliminate a problem with your environment as the culprit, can you see if this happens if you create a generic test app?

16 Jul 2015, 1:54 PM
Typically this means you've not called the observable constructor in your class, or tried to add listeners before it's been called.

16 Jul 2015, 6:21 PM
nothing changed after creating it via sencha cmd.

16 Jul 2015, 6:25 PM
Typically this means you've not called the observable constructor in your class, or tried to add listeners before it's been called.

Nothing changed after creating via sencha cmd, where should I call observable constructor, it seems the scaffold page not working in mobile mode.

19 Jul 2015, 5:20 AM
Hi Support,

OS: window7 64 bit.

Test case without workspace: test.zip

if anything more needed please let me know.


4 Aug 2015, 6:23 AM
Have same bug on Ubuntu 14.04 lts 64
Classic toolkit works fine, but modern displays nothing and there is the same error in the console.
Tested in chrome, in device mode

Uncaught TypeError: Cannot read property '_incr_' of undefinedprivates.doAddListener @ ext-modern-all-debug.js?_dc=20150804171444:13241Ext.Base.Base.addMembers.callParent @ ext-modern-all-debug.js?_dc=20150804171444:7581Ext.define.privates.doAddListener @ ext-modern-all-debug.js?_dc=20150804171444:26387Ext.Base.Base.addMembers.callParent @ ext-modern-all-debug.js?_dc=20150804171444:7581Ext.define.privates.doAddListener @ ext-modern-all-debug.js?_dc=20150804171444:47108Ext.Base.Base.addMembers.callParent @ ext-modern-all-debug.js?_dc=20150804171444:7581Ext.define.privates.doAddListener @ ext-modern-all-debug.js?_dc=20150804171444:51855addListener @ ext-modern-all-debug.js?_dc=20150804171444:12942Ext.Base.Ext.apply.createAlias.aliasOneMember.(anonymous function) @ ext-modern-all-debug.js?_dc=20150804171444:7514Ext.define.constructor @ ext-modern-all-debug.js?_dc=20150804171444:52052constructor @ ext-modern-all-debug.js?_dc=20150804171444:7874(anonymous function) @ VM1527:3Ext.ClassManager.Ext.apply.create @ ext-modern-all-debug.js?_dc=20150804171444:9141Ext.define.setup @ ext-modern-all-debug.js?_dc=20150804171444:52348(anonymous function) @ ext-modern-all-debug.js?_dc=20150804171444:42814Ext.env.Ready.invoke @ ext-modern-all-debug.js?_dc=20150804171444:10881Ext.env.Ready.doInvokeAll @ ext-modern-all-debug.js?_dc=20150804171444:10921Ext.env.Ready.invokeAll @ ext-modern-all-debug.js?_dc=20150804171444:10890Ext.env.Ready.handleReady @ ext-modern-all-debug.js?_dc=20150804171444:10858(anonymous function) @ ext-modern-all-debug.js?_dc=20150804171444:10868Ext.Function.ExtFunction.bind @ ext-modern-all-debug.js?_dc=20150804171444:4311(anonymous function) @ ext-modern-all-debug.js?_dc=20150804171444:4388

4 Aug 2015, 8:18 AM
Tested in chrome, in device mode

Does this happen to be Android device mode?

4 Aug 2015, 8:22 AM
Yes, i selected Samsung Galaxy III from the list.Also tested on Galaxy Note 10.1 tablet - modern toolkit doesn't work too,but if i switch browser(chrome) to full mode - classic toolkit works perfect

4 Aug 2015, 8:30 AM
I am easily able to reproduce this, I had this come up last week when a colleague asked if I had ever seen an error and like Evan said above in this thread is due to the observable mixin constructor not being called. This is due to the Ext.viewport.Android constructor:

constructor: function() {
orientationchange: 'hideKeyboardIfNeeded',
scope: this,

priority: 1001

var me = this;
Ext.onReady(function() {
Ext.getBody().on('resize', me.onResize, me);

The this.on method call before the callParent is the bug. An override to fix the bug is:

Ext.define('Override.viewport.Android', {
override : 'Ext.viewport.Android',

constructor : function() {
var me = this;


scope: me,
priority: 1001,
orientationchange: 'hideKeyboardIfNeeded'

Ext.onReady(function() {
Ext.getBody().on('resize', me.onResize, me);

Will be reporting this as a bug.

4 Aug 2015, 8:32 AM
Thanks for the report! I have opened a bug in our bug tracker.

4 Aug 2015, 8:37 AM
An override to fix the bug is
Explain for full newbie please, where to place this override, in new file? wich folder?
should i add this new class to requires?

4 Aug 2015, 8:38 AM
If you are using Cmd you can place the override in the overrides/viewport/Android.js and run a "sencha app build testing" or "sencha app watch" so that Cmd can tell Ext JS to load the Android.js file. It should be included automatically for you.

4 Aug 2015, 9:02 AM
Thank you, it works.Sorry for offtop, is there any way to fully disable modern mode and always work in classic, even at mobile devices?

4 Aug 2015, 9:06 AM
Sure, in your index.html you should see an inline script tag defining the Ext.beforeLoad function. Return 'classic' there to match your classic build. You could then comment out the modern build in the builds object in app.json so that when you do an app build it won't go through and run a build on the modern app.

4 Aug 2015, 9:11 AM
Thank you, it works again.

18 Aug 2015, 12:10 PM
Works for me.

Why is this a bug in Chrome device mode, but not on an actual Android?

26 Aug 2015, 2:18 PM
The problem is not resolved in the version Extjs 6.0-2.0

11 Sep 2015, 9:46 AM
yes, Sam Sung galaxy Note III. I have just tried with the latest Extjs 6.0.1 + cmd 6.0.1, works fine for this case. thank you...

11 Sep 2015, 9:48 AM
This issue fixed in 6.0.1, thanks Dev team.