Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ember Cannot read property 'shouldSupercede' of undefined with a new route

Tags:

ember.js

I've simply added a new route to my application and when I transition to it Ember throws the error "Cannot read property 'shouldSupercede' of undefined".

Here is my router:

App.Router.map ()->
    @resource 'pages', ->
        @resource 'page', {path: ':page_id'}, ->
            # lots of routes under here, all work

    @route 'design' # new route that error happens when transition to

I started looking through the router code but I'm really not sure what's going on and hoping that there is something obvious that I'm missing. If I add some logging inside ember the error is actually thrown when it's doing some lookup on the page route here, but again that route itself works fine.

Also it doesn't matter if I'm transitioning from the page route or not, if I just reload the page with it already at the design route I get the same error:

Transitioned into 'design' ember.js?body=1:14464
Uncaught TypeError: Cannot read property 'shouldSupercede' of undefined 
like image 959
DEfusion Avatar asked Oct 28 '14 11:10

DEfusion


1 Answers

One reason for this issue is a {{#link-to}} pointing at a route that has a dynamic segment without providing that segment.

The error message was definitely not very helpful in pointing in the right direction unfortunately.

like image 129
DEfusion Avatar answered Sep 29 '22 11:09

DEfusion