1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    7
    Vote Rating
    0
    actualeyes is on a distinguished road

      0  

    Default 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:
    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
    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
    Code:
    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:
    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
    The parent file looks like this:
    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

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    38,386
    Vote Rating
    1092
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default

    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 Software Engineer
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1