-
1 Nov 2012 11:16 AM #1
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
I get the following error:Code:$> sencha app build production
So, it simply adds its own namespace and tries to look for a file like 'Qwerty.store.MySpace.store.FormFields'.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 ........
To produce this error I create a new project as follows
I've added a store to app.js as followsCode:$> sencha generate app -path ~/Site/qwerty -name Qwerty
Thats all I changed. So I have two foldersCode://<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' ......
Inside the MySpace folder I have a store in src/store/FormFields.js and a model in src/model/FormField.jsCode:lrwxr-xr-x 1 Jean staff 21 Nov 1 19:47 qwerty drwxr-xr-x 3 Jean staff 102 Nov 1 19:50 MySpace
The store looks like
And finally a very simple model: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' } } } });
Is this a bug or is there something wrong with my configuration ?Code:Ext.define('MySpace.model.FormField',{ extend: 'Ext.data.Model', config: { fields: [ { name: 'name', type: 'string' }, { name: 'label', type: 'string' } ] } });
Cheers
-
Best Answer Posted by mitchellsimoens
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 Nov 2012 4:49 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
- Answers
- 3160
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.
-
3 Nov 2012 8:20 AM #3
I've used SDK version 2.1.0-rc2 and Sencha Cmd v3.0.0.201
Cheers
-
5 Nov 2012 9:01 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
- Answers
- 3160
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.
-
5 Nov 2012 10:16 AM #5
yes, thanks it works now!!
Is this somewhere documented in the sencha touch 2 docs ?
cheers
-
5 Nov 2012 10:37 AM #6Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
- Answers
- 3160
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.
-
5 Nov 2012 11:32 AM #7


Reply With Quote