Web App Development

Backbone LocalStorage - Uncaught TypeError Object has no method 'parse'

This problem occurs for when using Backbone.localStorage with Backbone 0.9.10+. The synchronization success callback's signature changed in that version, there's a fix coming up on Gitub.

The fix: Change two lines in the sync function of Backbone.localStorage. They are:
options.success(resp);
...
options.error(errorMessage);
And they need to be:
options.success(model, resp, options);
...
options.error(model, "Record not found", options);

Comments


Follow me on Twitter