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
I'm building monitoring tool for site speed and Core Web Vitals.
➔ Start monitoring your website or run a free site speed test