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

MANDATORY_SETTER_FUNCTION assertion causes errors on Component teardown with HTMLBars #10935

Closed
benlesh opened this issue Apr 22, 2015 · 10 comments

Comments

@benlesh
Copy link
Contributor

benlesh commented Apr 22, 2015

I'm currently consistantly running into an issue where Ember setting view.element = null; apparently on this line in HTMLBars

Causes an assertion error that is unhandled and breaking our app. Here's a screenshot:

screen shot 2015-04-22 at 11 38 44 am

@benlesh
Copy link
Contributor Author

benlesh commented Apr 22, 2015

This is specifically happening somewhere within the ember-nf-graph nf-graph-content component

... and it only started after I upgraded to Ember 1.11.1.

@rwjblue
Copy link
Member

rwjblue commented Apr 22, 2015

element is not an observable property, observing it would cause this error

@rwjblue
Copy link
Member

rwjblue commented Apr 22, 2015

I did a quick scan through the repo, and do not see an instance of you observing element. It could either be in a consuming application, or something like the inspector (having the inspector open can cause all properties on the object that is selected to be observed).

@benlesh
Copy link
Contributor Author

benlesh commented Apr 22, 2015

The only thing I can think of is that I'm accessing that DOM element via something like D3 in another component.

FWIW: I looked through version history and found that it used to use set in that area: 6af9b03#diff-d8303a7a1692ae012d56a3c6dad4ed2dL139

@benlesh
Copy link
Contributor Author

benlesh commented Apr 22, 2015

... but access it via D3 wouldn't cause that right?

It seems like something set up the element property on that component to have this default getter that does the assertion. I'm not sure where that is set up or why.

@rwjblue
Copy link
Member

rwjblue commented Apr 22, 2015

if you use another views element in a template somewhere else (I don't even know if that would work), the template usage would setup an observer on element and cause this error.

@rwjblue
Copy link
Member

rwjblue commented Apr 22, 2015

So, I suppose it depends how you use the element...

@benlesh
Copy link
Contributor Author

benlesh commented Apr 22, 2015

That's probably what's happening. nf-graph get's the nf-graph-content's element and sets up some events on it I think.

@benlesh
Copy link
Contributor Author

benlesh commented Apr 22, 2015

Bingo

That's the culprit, I'd wager. Thanks @rwjblue

@benlesh benlesh closed this as completed Apr 22, 2015
@benlesh
Copy link
Contributor Author

benlesh commented Apr 22, 2015

FWIW: Because Ember is so consistent, this seems like a "wat" in Ember. Everything else in Ember is delightfully uniform or at least gives you clean errors/assertions if you abuse a thing. As an author, I just assumed that Ember, being Ember, would allow me to observe, depend on, or get damn near anything

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

2 participants