This seems to only happen to coffeescript routes as I tried it with es6 on embertwiddle and didn't run into any problems.
I have the following code:
import Ember from 'ember'
CompaniesRoute = Ember.Route.extend
# model: -> []
export default CompaniesRoute
which translates to:
define('relationship/routes/companies', ['exports', 'ember'], function (exports, _ember) {
var CompaniesRoute;
CompaniesRoute = _ember['default'].Route.extend;
exports['default'] = CompaniesRoute;
});
When I access this route through URL, I get the following error message in console:
Error message: Assertion Failed: Expected route:companies to resolve to an Ember.Route but instead it was function () {
var Class = makeCtor();
var proto;
Class.ClassMixin = _emberMetal.Mixin.create(this.ClassMixin);
Class.PrototypeMixin = _emberMetal.Mixin.create(this.PrototypeMixin);
Class.ClassMixin.ownerConstructor = Class;
Class.PrototypeMixin.ownerConstructor = Class;
reopen.apply(Class.PrototypeMixin, arguments);
Class.superclass = this;
Class.__super__ = this.prototype;
proto = Class.prototype = Object.create(this.prototype);
proto.constructor = Class;
_emberUtils.generateGuid(proto);
_emberMetal.meta(proto).proto = proto; // this will disable observers on prototype
Class.ClassMixin.apply(Class);
return Class;
}.
It looks like it can't find that route without the model property because when I uncomment the model property above, it works. The error that is resulted is kind of confusing, especially to beginners since by all account the route "is" defined and there.
This seems to only happen to coffeescript routes as I tried it with es6 on embertwiddle and didn't run into any problems.
I have the following code:
which translates to:
When I access this route through URL, I get the following error message in console:
It looks like it can't find that route without the model property because when I uncomment the model property above, it works. The error that is resulted is kind of confusing, especially to beginners since by all account the route "is" defined and there.