PDA

View Full Version : [FIXED] [PR1] LocalStorage throwing error on 'sync()'



subimage
10 Nov 2011, 7:07 PM
So, I'm trying to use LocalStorage and running into problems immediately when calling sync. Terminal is reporting "TypeError: Cannot call method 'create' of undefined". This happens on Google Chrome on Mac OS X.

Here's my code, and an image of what's happening in my terminal.

I believe this is a huge bug. Fix ETA?

Error being thrown:

29223
Here's the code on pastie
(http://pastie.org/2845226)

Jamie Avins
11 Nov 2011, 8:46 AM
We are in the process of a large update to the Data package which should be part of the next release. Thank you for the report.

subimage
11 Nov 2011, 11:57 AM
ETA on PR2? I started making an app with v2, and it's pretty much unusable in it's current state for any kind of production app.

mitchellsimoens
11 Nov 2011, 6:54 PM
btw, PR2 is out. PR status is not meant to be deployed in a production environment.

joseph09
11 Nov 2011, 10:59 PM
Just switched to PR2 today and am now receiving the same error when trying to sync with localstorage, but did not receive the error using PR1.

Chrome Error: Uncaught TypeError: Cannot call method 'create' of undefined

Safari Error: TypeError: 'undefined' is not an object (evaluating 'me.proxy[operation.action]')



Ext.Loader.setConfig({ enabled: true });

Ext.application({
name: 'MyApp',
controllers: [],
models: [],
launch: function() {



Ext.define('Search', {
fields: ['id', 'query'],
extend: 'Ext.data.Model',
proxy: {
type: 'localstorage',
id : 'twitter-Searches'
}
});

var store = Ext.create('Ext.data.Store', {
model: "Search"
});

store.load();

store.add({query: 'Sencha Touch'});

store.sync();



}
});

gregk
26 Nov 2011, 1:22 PM
Same here.

joseph09
26 Nov 2011, 2:28 PM
@gregk - The workaround is in this thread -

http://www.sencha.com/forum/showthread.php?150673-localstorage-proxy-sync-error-Batch.js-related

gregk
26 Nov 2011, 4:42 PM
Thanks! I'll try it.

@gregk - The workaround is in this thread -

http://www.sencha.com/forum/showthread.php?150673-localstorage-proxy-sync-error-Batch.js-related

TommyMaintz
16 Jan 2012, 9:27 AM
This has been fixed and will be part of the next Touch 2.0 release. Thanks for the helpful report!