I'm going to try my best and break down the problem im facing here, And the basic summary is that I have a ember-cli project and no matter what I do the index route will not load. But all my other routes load just fine.
//BROKEN ROUTE IMAGE http://i.stack.imgur.com/KB7Mw.png
//WORKING ROUTE IMAGE http://i.stack.imgur.com/YzheD.png
At first I thought well maybe it was my handlebars template. Then I updated to the latest version of ember-cli and used htmlbars, its still not showing. So I traced the Promise to see if there was any hope there:
VM66628:70 Ember Inspector (Promise Trace): Ember: Process errors from Router
at new Promise (http://localhost:4200/assets/vendor.js:59149:9)
at Promise.then (http://localhost:4200/assets/vendor.js:59387:21)
at Object.Transition.then (http://localhost:4200/assets/vendor.js:56759:29)
at didBeginTransition (http://localhost:4200/assets/vendor.js:34821:16)
at EmberObject.default.extend._doURLTransition (http://localhost:4200/assets/vendor.js:34104:7)
at EmberObject.default.extend.handleURL (http://localhost:4200/assets/vendor.js:34099:19)
at EmberObject.default.extend.startRouting (http://localhost:4200/assets/vendor.js:33986:38)
at exports.default.EmberObject.default.extend.startRouting (http://localhost:4200/assets/vendor.js:14194:14)
at Namespace.default.extend.didBecomeReady (http://localhost:4200/assets/vendor.js:14904:37)
VM66628:70 Ember Inspector ($E): TypeError: Cannot read property 'extend' of undefined
at http://localhost:4200/assets/redberry-ios.js:1871:77
at mod.state (http://localhost:4200/assets/vendor.js:150:29)
at tryFinally (http://localhost:4200/assets/vendor.js:30:14)
at requireModule (http://localhost:4200/assets/vendor.js:148:5)
at requireFrom (http://localhost:4200/assets/vendor.js:121:12)
at reify (http://localhost:4200/assets/vendor.js:106:22)
at mod.state (http://localhost:4200/assets/vendor.js:149:17)
at tryFinally (http://localhost:4200/assets/vendor.js:30:14)
at requireModule (http://localhost:4200/assets/vendor.js:148:5)
at resolveOther (http://localhost:4200/assets/vendor.js:60054:20)
So i thought well maybe my Route/Application or Route/Index is bad.
//APPLICATION ROUTE
import Ember from 'ember';
export default Ember.Route.extend({
actions: {
sessionAuthenticationFailed: function(params) {
this.controllerFor('sessions/new').set('errorMessage', params.error);
},
error: function(error, transition) {
this.render('error', {
into: 'application'
});
}
}
});
//INDEX ROUTE
import Ember from 'ember';
export default Ember.Route.extend({
model: function() {
return this.store.find('product');
},
actions: {
}
});
//A ROUTE THAT WORKS
import Ember from 'ember';
export default Ember.Route.extend({
model: function() {
return Ember.Object.create();
},
activate: function() {
this._super();
document.title = "Sign In";
}
});
And now Im not exactly sure what to think because I can't find any documentation on this. I feel like it shouldn't be occurring but in case someone else has this issue I would love to know the solution.
MY adapter:
Ill be spending a few more hours looking into it, but the adapter looks fine:
import DS from 'ember-data';
import Ember from 'ember';
import ENV from "../config/environment";
Ember.$.ajaxSetup({
crossDomain: true,
xhrFields: {
withCredentials: true
}
});
export default DS.ActiveModelAdapter.extend({
namespace: ENV.NAMESPACE,
host: 'http://testing.herokuapp.com'
});
UPDATE:
So everyone can see that Im not passing dymanic segments although it says I am this is what my template looks like:
<!--APPLICATION.HBS-->
{{outlet "modal"}}
{{partial "header"}}
<div class="interior">
<div class="wrapper">
<div class="row">
<div class="span14 list-view">
{{outlet}}
</div>
</div>
</div>
{{partial "footer"}}
</div>
<!--HEADER.HBS-->
<div class="nav">
<ul class="ul-left">
<li>{{#link-to 'index' tagName="a"}}
<h1><i class="rb-redberry error"></i></h1><!--{{make-title titleName}}-->
{{/link-to}}</li>
</ul>
<ul class="ul-right">
</ul>
</div>
<!--HEADER.HBS-->
<h1>Hello I am the Index and I loaded</h1>
<!--FOOTER.HBS-->
<div id="footer">
<div class="span14">
<div class="row centered">
<div class="span9">
<ul>
<li>Home</li>
<li>Shop</li>
<li>About Us</li>
<li>Blog</li>
<li>Become a Seller</li>
<li>Contact Us</li>
<li>Terms of Use</li>
</ul>
</div>
<div class="span3">
<div class="row"></div>
<div class="row"></div>
</div>
</div>
</div>
</div>
UPDATED UPDATE:
I figured out that the dynamic segments was being caused by creating a error resource. After removing that I was able to single it down to one error.
Error while processing route: index Cannot read property 'extend' of undefined TypeError: Cannot read property 'extend' of undefined
errorpart of your application route and see if anything changes. Good reference about ember errors here: speakerdeck.com/elucid/ember-errors-and-you - Kori John RoysError: More context objects were passed than there are dynamic segments for the route: errorNow that message is only weird because the index has no dynamic segments its the main index afterall. - artsmc