Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parent component is destroyed: Cannot read property 'removeObserver' of undefined #61

Closed
manuel-reil opened this issue Jul 20, 2017 · 6 comments

Comments

@manuel-reil
Copy link

I use the can helper in a component template. On click an action bubbles up to the controller, that filters and destroys the component.

Then the following error is logged to console:

TypeError: Cannot read property 'removeObserver' of undefined
    at Class.destroy (can.js:33)

Potential fix:

Check in addon/helpers/can.js if this._ability exists:

if (this._ability) {
  this._ability.removeObserver(this._abilityProp, this, 'recompute');
}

This avoids the particular error in my case, but I do not have the Ember knowledge if the can observer is removed in this case somehow automatically. Typically, automatically does not exist...

@manuel-reil
Copy link
Author

This happens when the can helper is used inside nested {{#if}} in a template. Maybe it is not possible to detect the destruction early enough.

@FilmKnurd
Copy link
Contributor

Having the same problem. This seems to work pretty well.

@ErunamoJAZZ
Copy link

I had a very bad day due this issue. I was porting an app from ember 2.8 to 2.16 and this had some weird behavior after fails (more glimmer errors and etc).

I hope someone will merge soon. Thank you guys!

@blimmer
Copy link
Contributor

blimmer commented Oct 21, 2017

I'm merged and released as 0.8.5.

Myself and @rlivsey don't currently have the time to be very active on this project - is anyone interested in helping maintain this project?

@acorncom
Copy link

Looks like this issue can be closed now ... @blimmer I'm likely to start using this add-on in a client project in the next few weeks, what type of help are you looking for here?

@blimmer
Copy link
Contributor

blimmer commented Oct 31, 2017

Hey @acorncom - thanks for the offer. It seems there's something wrong with the cannot helper as many people have posted about it. There are also some failing tests that could use some touch-up. If you have any time to work on that stuff, I'll happily try to help you get that across the line.

@Exelord Exelord closed this as completed Apr 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants