Could "calling set on destroyed object" error be more descriptive?


#1

Today after spending four hours trying to find out what is causing “calling set on destroyed object” I’ve gave up, opened Ember source, looked up error message and changed it to following:

Ember['default'].assert("calling set('" + keyName + "') on destroyed object", !obj.isDestroyed);

This finally produced following error:

Uncaught Error: Assertion Failed: calling set('isVisible') on destroyed object

This allowed me to isolate and fix origin of problem instantly.

Could please this little fix land in source? Perfectly, Error with dumps of both object and value would help in identifying test cases that trouble origins from, but thay may be tricky to get done.


#2

I would file this over in the ember repo, it may get lost here.


#3

Hi, any updates on this?


#4

'Lo 'ere Nikos,

Work is happening on this, but nothing was finalised yet:

Issue: https://github.com/emberjs/ember.js/issues/10865

PR: https://github.com/emberjs/ember.js/pull/11381

Other PR: https://github.com/emberjs/ember.js/pull/11426


#5

After editing source code I don’t get the updated error message. Does Ember-CLI use the minified version, if so how did you get round this?

--------EDIT--------

Solved my problem, was editing ember.js whereas in newer versions of CLI in dev mode, it is ember.debug.js it is using.