PDA

View Full Version : Common components are not being pulled by the correct namespace by the sencha tool.



actualeyes
20 Jan 2012, 1:28 PM
We recently re-organized ourapplication to extract common code into a
'shared' directory, with Model, view,controller and store elements.
Since doing this, we have been able toload the app when using dynamic
loading in a dev environment, but havenot succeeded in using 'sencha
create jsb' and 'sencha build' tocreate a minified version of the app
that will load quicker.
When I run the 'sencha create jsbcommand', I get output as follows:

export DISPLAY=":1" ; senchacreate jsb -a index.html -p app.jsb3
undefined:0 Ext.Loader is not enabled,so dependencies cannot be resolved dynamically. Missing requiredclasses: SHARED.model.SHARED.model.Header,SHARED.view.SHARED.view.header.Header,SHARED.store.SHARED.store.Header
undefined:0 Ext.Loader is not enabled,so dependencies cannot be resolved dynamically. Missing requiredclasses: SHARED.model.SHARED.model.AccountManager,SHARED.model.SHARED.model.UserName,SHARED.store.SHARED.store.AccountManagers,SHARED.store.SHARED.store.UserNames
As you can see, the namespace path isDUPLICATED.
SHARED.model.SHARED.model . I caneliminate the error by changing
the declarations in my sharedcontrollers, that is to say remove the
path prefix.
---- The following file allows the appto work in a dev environment, but
fails when running sencha build

Ext.define('SHARED.controller.AccountManagers',{
extend: 'Ext.app.Controller',
models: [
'SHARED.model.AccountManager',
'SHARED.model.UserName'
],

stores: [
'SHARED.store.AccountManagers',
'SHARED.store.UserNames'
],
views: [
'accountmanager.List'
]

});
---- the followin file allows thesencha build command to succeed, but fails at page load time
with errors in the Javascript console:

GEThttps://admin.www106.dev1.vcmedia.com/beta/advertiser/campaign_grid/app/store/AccountManagers.js?_dc=1327090500950500 (Internal Server Error)
Uncaught TypeError: object is not afunction

The parent file looks like this:

Ext.Loader.setConfig({
enabled: true,
paths: {
'SHARED':'campaign_grid/shared'
}
});
Ext.application({
name: 'CIDGrid',
appFolder: 'campaign_grid/app',
controllers: [
'SHARED.controller.AccountManagers',
'SHARED.controller.ChartSummary',
'SHARED.controller.Header',
'Campaigns'
],
[...]



I can't find any place where the pathto the SHARED directories are specified in a way that would causethem
to be duplicated this way. I'mwondering if I've made a configuration error, or if there's a bug inthe
sencha build jsb command.
Any and all input appreciated.

Actualeyes

mitchellsimoens
23 Jan 2012, 12:51 PM
It's saying Ext.Loader isn't enabled but you have enabled : true in setConfig... try running the create command against the index.html on a webserver... http://...../index.html