Error in building Sencha Touch 2 application
javascript, list, load, sencha-touch, sencha-touch-2
Solution
I have the same issue, the command builder isn't allowed to open a connection to localstorage so it crashes.
You should be able to set `Ext.getStore('Members').setAutoLoad(true);` in the ` launch: function () {` of `app.js`.
Then your app will build and should still load the data into the store.
Problem
While I am building my sencha touch 2 app using the command:- sencha app build production but it throws an error: ``` [INFO] Deploying your application to /Applications/MAMP/htdocs/iPadapp/build/production [INFO] Copied sdk/sencha-touch.js [INFO] Copied app.js [INFO] Copied resources/css/app.css [INFO] Copied resources/images [INFO] Copied resources/icons [INFO] Copied resources/loading [INFO] Resolving your application dependencies... [ERROR] Error thown from your application with message: TypeError: 'undefined' is not an object ``` I traced the error in my code . I found out , it is due to loading my list. Here is my code ``` Ext.define("myProject.store.Members",{ extend :'Ext.data.Store', requires:"Ext.data.proxy.LocalStorage", config: { model :"myProject.model.Member", sorters :'lastName', autoload:true, proxy: { type: 'localstorage', id : 'mainStore' } } }); ``` if I remove the line 'autoLoad: true' ( which breaks my application, then I can build the application. But my list is not loading. If I put it back the error repeats. I tried dynamically loading the list with load function , but it does not make any sense. And here is the model.js file I amusing. ``` Ext.define('myProject.model.Member', { extend: 'Ext.data.Model', config: { fields: [ 'index', 'email', 'firstname', 'lastname', 'phone', 'currentemployer', 'currenttitle', 'interestlevel', 'tcgroupNames', 'active', 'lastlogin', 'usertypedesc', 'recruiternotes', 'recruitercontact', 'addtype', 'usertypedesc', 'jobtitle', 'ipAddress', 'recruitersource', 'agentkeywords', { name: "created", type: 'date' }, 'recruiterprofileurl_linkedin', 'recruiterprofileurl_facebook' ] } }); ``` Any Help is appreciated Happy coding to all