chrisfarber / ember-breadcrumbs

An Ember.js component for adding breadcrumbs to your app.
MIT License
79 stars 34 forks source link

[BUG] Observing the routes' controller throws mandatory setter errors #21

Closed joostdevries closed 9 years ago

joostdevries commented 9 years ago

Because you're registering observers on the routes controller, this is causing MANDATORY_SETTER errors because Ember.Route sets the controller using this.controller = controller.

We just spent about quite a few hours trying to figure out why we could only navigate to a route once all of a sudden ;-)

chrisfarber commented 9 years ago

Which version of ember are you using, and do you have any special feature/build flags set?

joostdevries commented 9 years ago

Happened on 1.9.1 and 1.10.0. No specific flags.

Basically I could navigate to a route once but if I would exit the route and re-enter it I'd get the MANDATORY_SETTER error, failing on this line: https://github.com/emberjs/ember.js/blob/730fb0c767182ed5be7e597e4b2bc99627894495/packages/ember-routing/lib/system/route.js#L1058

This is usually caused when something is observing the controller property of the route. In this case reverting Ember Breadcrumbs to v0.1.1 fixed the issue for us

chrisfarber commented 9 years ago

Thanks. I think the fault lies here: f5c7c5511351124ee05d2d67bc699c3c4f0f8523.

I'll have this fixed for the next release. In the meantime, unless you need multiple crumbs per controller, sticking with 0.1.1 is a good workaround.

joostdevries commented 9 years ago

:+1:

chrisfarber commented 9 years ago

I cut a new release of ember-breadcrumbs, 0.1.3, that I hope will fix this.

I wasn't able to reproduce this issue locally with 0.1.2, ember-breadcrumbs-sample-app, and Ember 1.10.0, so I'd appreciate it if you could try out 0.1.3 and let me know if it works.

Thanks!

joostdevries commented 9 years ago

Just ran our suite on 0.1.3 and no issues detected. :+1: Thanks.