0
votes

Problem

After upgrading to the newest ember.js I get this error:

Uncaught Error: assertion failed: Could not find state for path: "loading"

Looking at the framework code, it seems that ember wants to route to a 'loading' route until the ember data promises return. I didn't see any documentation about a 'loading' route, so just tried adding one like this:

loading: Ember.Route.extend({
}),

which results in the error:

Uncaught Error: assertion failed: Loading state should not be a route

Clues

  • Running build from master (commit 693c8185fbda70df523bb60d21f3dc6d9d94b018)
  • Using the old router build (ember-old-router.js) so I can upgrade without rewriting my router
  • Error only happens when I navigate directly to the URL. It does not happen when I route from a sibling route.

Question

Should I be defining a loading route somewhere? If so, what is the syntax? If not, how can I prevent this error?

1

1 Answers

0
votes

That's a curious issue, because I thought Ember.StateManager/Ember.State were no longer used, but it seems like you're using them somewhere.

Why is this?

Nevertheless, by declaring loading as an Ember.State, it should at least fix your problem, but unless I'm horribly mistaken, you should be moving well away from Ember.State in favour of the new router.

loading: Ember.State.extend();