1. #1
    Sencha User
    Join Date
    Jun 2010
    Posts
    134
    Vote Rating
    3
    jeanluca is on a distinguished road

      0  

    Default Answered: cannot build 'production' using external store

    Answered: cannot build 'production' using external store


    Hello
    In my app.js file I have defined an external store 'MySpace.store.FormFields'. When a do

    Code:
    $> sencha app build production
    I get the following error:

    Code:
    [INFO ]        Processing classPath entry : /Users/Jean/Site/qwerty/app.js
    [INFO ]        Processing classPath entry : /Users/Jean/Site/qwerty/app
    [ERROR]        def was null
    [ERROR]        failed to find meta class definition for name Qwerty.store.MySpace.store.FormFields
    [ERROR]        BUILD FAILED
    ........
    So, it simply adds its own namespace and tries to look for a file like 'Qwerty.store.MySpace.store.FormFields'.
    To produce this error I create a new project as follows

    Code:
    $> sencha generate app -path ~/Site/qwerty -name Qwerty
    I've added a store to app.js as follows

    Code:
    //<debug>Ext.Loader.setPath({
        'Ext': 'touch/src',
        'Qwerty': 'app',
        'MySpace': '../MySpace/src' // <------ include external project
    });
    //</debug>
    
    
    Ext.application({
        name: 'Qwerty',
    
    
        views: ['Main'],
        stores: ['MySpace.store.FormFields'],  <----- define the 'external 'store'
        ......
    Thats all I changed. So I have two folders

    Code:
    lrwxr-xr-x    1 Jean  staff        21 Nov  1 19:47 qwerty
    drwxr-xr-x    3 Jean  staff       102 Nov  1 19:50 MySpace
    Inside the MySpace​ folder I have a store in src/store/FormFields.js and a model in src/model/FormField.js

    The store looks like

    Code:
    Ext.define('MySpace.store.FormFields',{
        extend: 'Ext.data.Store',
        requires: ['Ext.data.proxy.Rest', 'MySpace.model.FormField'],
        
        config:
        {
            model: 'MySpace.model.FormField',
            proxy:
            {
                type: 'rest',
                url: '/api/field',
                reader:
                {
                    type: 'json',
                    rootProperty: 'fields'
                },
                headers: {
                    Accept: 'application/json'
                }
            }
        }
    });
    And finally a very simple model:

    Code:
    Ext.define('MySpace.model.FormField',{
        extend: 'Ext.data.Model',
    
    
        config:
        {
            fields: [
            {
                name: 'name',
                type: 'string'
            },
            {
                name: 'label',
                type: 'string'
              } ]
        }
    });
    Is this a bug or is there something wrong with my configuration ?

    Cheers

  2. You need to add the path to the directory of the other namespace in the .sencha/app/sencha.cfg in the app.classpath so that Cmd can find that namespace. Cmd does not use the paths in app.js to resolve classes

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    34,121
    Vote Rating
    453
    Answers
    3160
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    What ST2 version are you using?
    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.

  4. #3
    Sencha User
    Join Date
    Jun 2010
    Posts
    134
    Vote Rating
    3
    jeanluca is on a distinguished road

      0  

    Default


    I've used SDK version 2.1.0-rc2 and Sencha Cmd v3.0.0.201

    Cheers

  5. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    34,121
    Vote Rating
    453
    Answers
    3160
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    You need to add the path to the directory of the other namespace in the .sencha/app/sencha.cfg in the app.classpath so that Cmd can find that namespace. Cmd does not use the paths in app.js to resolve classes
    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.

  6. #5
    Sencha User
    Join Date
    Jun 2010
    Posts
    134
    Vote Rating
    3
    jeanluca is on a distinguished road

      0  

    Default


    yes, thanks it works now!!

    Is this somewhere documented in the sencha touch 2 docs ?

    cheers

  7. #6
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    34,121
    Vote Rating
    453
    Answers
    3160
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    The docs will be updated when GA comes out for 2.1 and Cmd. I'm not 100% sure if there is going to be a big section on this part but it will increasingly be more talked about.
    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.

  8. #7
    Sencha User
    Join Date
    Jun 2010
    Posts
    134
    Vote Rating
    3
    jeanluca is on a distinguished road

      0  

    Default


    ok, thnx!