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

Uncaught TypeError: Cannot read property 'enter' of undefined , while using transitionToRoute #12251

Closed
ghost opened this issue Aug 31, 2015 · 3 comments

Comments

@ghost
Copy link

ghost commented Aug 31, 2015

I am getting an "Uncaught TypeError: Cannot read property 'enter' of undefined". This is when i am using transitionToRoute in a controller.
The transitionToRoute function in controller,

transitionToRoute: function() {
// target may be either another controller or a router
var target = get(this, 'target');
var method = target.transitionToRoute || target.transitionTo;
return method.apply(target, arguments);
},

here the target variable is being assigned a view instead of controller or router. I don't know if this is a issue or am i using transitionToRoute in a wrong way. Need help here.

EDIT: The above function can be found here, https://github.com/emberjs/ember.js/tree/v2.0.1/packages/ember-routing/lib/ext/controller.js#L41

EDIT: In the above function, it calls get function with a controller object as "this", looking for "target" key in it. When i log "this.target" in transitionToRoute it prints a route class, but if i log the same variable in get function i get a view class.

I have no clue how this is happening.

@rwjblue
Copy link
Member

rwjblue commented Aug 31, 2015

This is going to be pretty hard for us to help with. Could you provide a JSBin or ember-twiddle.com example to help us narrow down what is going on?

@ghost
Copy link
Author

ghost commented Sep 1, 2015

I am sorry to raise a issue, but it was a plugin which i was using causing the issue. Plugin was modifying the target key of controller and resetting it back.

@ghost ghost closed this as completed Sep 1, 2015
@rwjblue
Copy link
Member

rwjblue commented Sep 1, 2015 via email

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant