Search code examples
javascriptember.jsember-datayeomanyeoman-generator

code breaks when switching to LSAdapter


I generated an app using yeoman and then followed the Getting Started section from the ember docs

Everything works fine when I use the FixtureAdapter, but when I change to the LSAdapter and try to mark a todo as complete I get the error:

Cannot call method 'lookup' of undefined from ember-data line 217.

If I try to delete a record I get the error:

Uncaught Error: Attempted to handle event `deleteRecord` on <EmberYeoman.Todo:ember309:ihdlu> while in state root.loaded.updated.inFlight.

both coming from ember-data.

Why does my code break when I switch adapters?


Solution

  • It would be very nice if you provide more information about your app. Without that only a very general answer is possible.

    Local Storage Adapter (LSAdapter) for Ember Data is broken for newer version of Ember Data. The latest version in the official github branch is written and tested with Ember Data alpha. Since then Ember Data has had bigger changes.

    Kurko is already working on compatibility with Ember Data beta 5. You find the GitHub issue here: https://github.com/rpflorence/ember-localstorage-adapter/pull/30