Uncaught Error: Assertion Failed: calling set on destroyed object

This is either because in the result of a promise or any other deferred code you do not check the destroy status of an object, or because you didn’t teardown something that has been setup and interact with DOM events or anything external to the core of Ember.

I used to have this especially on some jQuery plugins which I mapped to Ember, and during the tests the plugins were destroying too slowly and I was then either not using a run loop, or not checking the destroyed status of the Ember object I was manipulating.

You can do so with:

if ( !(obj.get('isDestroyed') || obj.get('isDestroying')) ) {
  // do your destroying code setting stuff
}

Also think about destroying any jQuery plugins that might have been initialised in the code of your views (anything setup in didInsertElement should be teardown in willDestroyElement for example).

Leave a Comment