Chart classes doesnt seam to be included during build
Steps to reproduce the problem:
Create an app with Pie or any Chart and try to compile it
The result that was expected:
Application working as on dev mode
The result that occurs instead:
Blue screen, app not loading and error message about an undefined function
I have created a demo app connected to Salesforce. To give you a general idea of the architecture give a look to http://vzmind.tumblr.com/post/345563...-sinatra-proxy. The final app objective is to display Leads list and charts of Opportunities (Pie, Bar, Line). Everything works fine locally and on Heroku as long as the application is not compiled ("built").
Then troubles occur: I want to compile app using Sencha Cmd.
The simple version of the app (homepage + a list) compiles properly, so far so good.
However, the graph version (homepage + a list + _graphs_) does NOT.
The build output is correct but the result app through 2 errors on Chrome
I observed that Ext.chart.series.Pie class definition was missing from the output app.js file. I kind of figured out how to fix the 404 by adding the file at the appropriate URL.
Again I solved them partiall by adding the whole src/chart folder at the appropriate URL.
At the end that error remains:
Code:
Uncaught TypeError: object is not a function
The full error stack is:
Code:
Uncaught TypeError: Cannot call method 'substring' of undefined app.js:2526
Ext.ClassManager.parseNamespace app.js:2526
Ext.ClassManager.get app.js:2602
Ext.ClassManager.instantiate app.js:2766
Ext.ClassManager.instantiateByAlias app.js:2758
Ext.apply.factory app.js:3941
Ext.define.applyInteractions app.js:34845
j app.js:2290
b.implement.initConfig app.js:1998
Ext.define.constructor app.js:9785
b.implement.callParent app.js:1935
Ext.define.constructor app.js:15146
b.implement.callSuper app.js:1939
Ext.define.constructor app.js:25549
b.implement.callSuper app.js:1939
Ext.define.constructor app.js:34631
f app.js:2157
(anonymous function)
Ext.ClassManager.instantiate app.js:2788
Ext.ClassManager.instantiateByAlias app.js:2758
Ext.apply.factory app.js:3949
Ext.define.factoryItem app.js:15307
Ext.define.add app.js:15337
Ext.define.applyItems app.js:15256
j app.js:2290
(anonymous function) app.js:2311
Ext.define.applyActiveItem app.js:15624
(anonymous function) app.js:7288
b.implement.initConfig app.js:1998
Ext.define.constructor app.js:9785
b.implement.callParent app.js:1935
Ext.define.constructor app.js:15146
f app.js:2157
(anonymous function)
Ext.ClassManager.instantiate app.js:2788
Ext.ClassManager.instantiateByAlias app.js:2758
Ext.apply.factory app.js:3949
Ext.define.factoryItem app.js:15307
Ext.define.add app.js:15337
Ext.define.applyItems app.js:15256
j app.js:2290
(anonymous function) app.js:2311
Ext.define.applyActiveItem app.js:15624
(anonymous function) app.js:7288
b.implement.initConfig app.js:1998
Ext.define.constructor app.js:9785
b.implement.callParent app.js:1935
Ext.define.constructor app.js:15146
f app.js:2157
(anonymous function)
Ext.ClassManager.instantiate app.js:2788
Ext.apply.factory app.js:3964
Ext.define.factoryItem app.js:15307
Ext.define.add app.js:15337
Ext.define.applyItems app.js:15256
j app.js:2290
(anonymous function) app.js:2311
Ext.define.applyActiveItem app.js:15624
(anonymous function) app.js:7288
b.implement.initConfig app.js:1998
Ext.define.constructor app.js:9785
b.implement.callParent app.js:1935
Ext.define.constructor app.js:15146
f app.js:2157
(anonymous function)
Ext.ClassManager.instantiate app.js:2788
Ext.ClassManager.instantiateByAlias app.js:2758
Ext.apply.factory app.js:3949
Ext.define.factoryItem app.js:15307
Ext.define.add app.js:15337
Ext.application.launch app.js:44390
Ext.define.onDependenciesLoaded app.js:19113
Ext.apply.require app.js:3315
(anonymous function) app.js:1401
Ext.define.loadControllerDependencies app.js:19098
Ext.apply.require app.js:3315
(anonymous function) app.js:1401
Ext.define.onProfilesLoaded app.js:19083
Ext.apply.require app.js:3315
(anonymous function) app.js:1401
(anonymous function) app.js:18986
Ext.apply.require app.js:3315
(anonymous function) app.js:1401
Ext.define.constructor app.js:18984
f app.js:2157
b.onReady app.js:3862
Ext.apply.onDocumentReady app.js:4063
o app.js:3400
Ext.apply.onReady app.js:3404
Ext.onReady app.js:3425
g app.js:3720
Ext.define.doAddListener app.js:42296
Ext.define.changeListener app.js:7098
Ext.define.addListener app.js:7143
(anonymous function) app.js:1896
(anonymous function) app.js:3746
Ext.apply.require app.js:3315
(anonymous function) app.js:1401
(anonymous function) app.js:3745
b app.js:3915
h app.js:3911
Ext.apply.factoryConfig app.js:3905
b app.js:3920
h app.js:3911
Ext.apply.factoryConfig app.js:3905
b app.js:3920
h app.js:3911
Ext.apply.factoryConfig app.js:3905
b app.js:3920
h app.js:3911
Ext.apply.factoryConfig app.js:3905
b app.js:3920
h app.js:3911
Ext.apply.factoryConfig app.js:3905
b app.js:3920
h app.js:3911
Ext.apply.factoryConfig app.js:3905
b app.js:3920
h app.js:3911
(anonymous function) app.js:3876
Ext.apply.factoryConfig app.js:3905
(anonymous function) app.js:3875
Ext.apply.require app.js:3315
(anonymous function) app.js:1401
Ext.apply.factoryConfig app.js:3874
b app.js:3920
h app.js:3911
(anonymous function) app.js:3876
Ext.apply.factoryConfig app.js:3905
(anonymous function) app.js:3875
Ext.apply.require app.js:3315
(anonymous function) app.js:1401
Ext.apply.factoryConfig app.js:3874
b app.js:3920
h app.js:3911
b app.js:3915
h app.js:3911
(anonymous function) app.js:3876
Ext.apply.factoryConfig app.js:3905
(anonymous function) app.js:3875
Ext.apply.require app.js:3315
(anonymous function) app.js:1401
Ext.apply.factoryConfig app.js:3874
b app.js:3920
h app.js:3911
(anonymous function) app.js:3876
Ext.apply.factoryConfig app.js:3905
(anonymous function) app.js:3875
Ext.apply.require app.js:3315
(anonymous function) app.js:1401
Ext.apply.factoryConfig app.js:3874
b app.js:3920
h app.js:3911
(anonymous function) app.js:3876
Ext.apply.factoryConfig app.js:3905
(anonymous function) app.js:3875
Ext.apply.require app.js:3315
(anonymous function) app.js:1401
Ext.apply.factoryConfig app.js:3874
b app.js:3920
h app.js:3911
(anonymous function) app.js:3876
Ext.apply.factoryConfig app.js:3905
(anonymous function) app.js:3875
Ext.apply.require app.js:3315
(anonymous function) app.js:1401
Ext.apply.factoryConfig app.js:3874
b app.js:3920
h app.js:3911
(anonymous function) app.js:3876
Ext.apply.factoryConfig app.js:3905
(anonymous function) app.js:3875
Ext.apply.require app.js:3315
(anonymous function) app.js:1401
Ext.apply.factoryConfig app.js:3874
b app.js:3920
h app.js:3911
(anonymous function) app.js:3876
b app.js:3915
h app.js:3911
b app.js:3915
h app.js:3911
(anonymous function) app.js:3876
Ext.apply.factoryConfig app.js:3905
(anonymous function) app.js:3875
Ext.apply.require app.js:3315
(anonymous function) app.js:1401
Ext.apply.factoryConfig app.js:3874
b app.js:3920
h app.js:3911
(anonymous function) app.js:3876
Ext.apply.factoryConfig app.js:3905
(anonymous function) app.js:3875
Ext.apply.require app.js:3315
(anonymous function) app.js:1401
Ext.apply.factoryConfig app.js:3874
b app.js:3920
h app.js:3911
(anonymous function) app.js:3876
Ext.apply.factoryConfig app.js:3905
(anonymous function) app.js:3875
It seams that Series Class is not loaded or something like that related to Chart Classes loading. I dont know how to debug such error.
I use Sencha Touch 2.1 GPL (which include theoretically Sencha Chart 2) + Sencha Cmd 3.0.0.250.
The build command is the standard one:
Code:
sencha app build package/testing/production
Attached is my app.js resulting file.
Any thought? Need more info to figure out what's wrong just tell me. I am working on Sencha since few weeks and that forum has always been resourceful for me. Will be happy to contribute back now
Last edited by vspehner; 12 Nov 2012 at 11:00 AM.
Reason: Update to expected bug report format
Hum I did a wrong copy and paste for the Stack. Sorry for that Mitchell.
The bug is "Object is not a function" and not "Cannot call method 'substring'"
As said that application works properly whn running in dev/debug mode. I have added the resulting index.html. How to avoid compression of the js part of index.html?
Last edited by vspehner; 13 Nov 2012 at 1:14 AM.
Reason: clarify a question
So far I havent find any explanation why the build is not including Charts properly into the resulting app.js file. Has anybody already successfully built a chart app with Sencha Touch 2.1 and Sencha Cmd 3.0.0.250?
Last edited by vspehner; 15 Nov 2012 at 1:19 AM.
Reason: typo
That error means you are trying to create a component that it's class name or xtype is not defined usually because the file is not loaded.
Thanks so much! after deeper digging, the missing class is found!.
It seems Ext.chart is a special view control that will 'preload' the chart before the page (containing the chart) actually created. Requires 'Ext.chart.*' on very beginning like on the 'app.js' (may be it is a best practice to do that).