-
20 Jan 2012 1:28 PM #1
Common components are not being pulled by the correct namespace by the sencha tool.
Common components are not being pulled by the correct namespace by the sencha tool.
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:
As you can see, the namespace path isDUPLICATED.Code: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
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
---- the followin file allows thesencha build command to succeed, but fails at page load timeCode: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' ] });
with errors in the Javascript console:
The parent file looks like this:Code: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
Code: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
-
23 Jan 2012 12:51 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,689
- Vote Rating
- 435
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
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote