chrisfarber / ember-breadcrumbs

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

Cannot read property 'currentHandlerInfos' of null in Ember 1.12.1 #34

Open alvinvogelzang opened 9 years ago

alvinvogelzang commented 9 years ago

In Ember 1.12.1 I got the following error:

Uncaught TypeError: Cannot read property 'currentHandlerInfos' of null.I tried to debug this and when I do this.get('router') I get function Class();

screen shot 2015-06-10 at 17 31 56

On a page where the breadcrumbs are working I also did this.get('router') and there I received a class with the properties as expected.

screen shot 2015-06-10 at 17 37 15

Do you have an idea why this is happening? Meanwhile I'll also try to fix it.

alvinvogelzang commented 9 years ago

Okay I found why this error is happening. I subclassed your addon several times and I imported the router by using the import Router from 'app/router' instead of injecting it in an initializer. So now I'll inject the router and applicationController in every subclass / extension of your addon. Not really elegant. Do you think there's a better way to do this?