Error while processing route while working on EAK to CLI migration of Route Model with Promise.all


I have an EAK app which I upgraded for ember 1.10 and am now attempting to migrate to CLI. In my Route model(), I assemble 2 data objects in ‘requests’, then pass that into Promise.all() to be returned in a new object. EAK uses api-stub, but with CLI I’m using ‘ember-cli-api-stub-static’ and I’ve confirmed that the JSON data is served up. With this framework I often get ‘error for this or that’ with no clue as to why. What is it about CLI that makes this block of code fail to work? How can I debug to find the root cause?

model: function(params){

var requests = [ 
  new Ember.RSVP.Promise(function(resolve, reject){
  new Ember.RSVP.Promise(function(resolve,reject){
return Ember.RSVP.Promise.all(requests, "Resolving data")
  .then(function (data) {
    return Ember.Object.create({
      descriptiveContents: data[0],
      configuration: data[1]



I can see the AJAX GET in the console, with 200 OK response, yet the function goes to the ‘fail’ rather than the ‘done’ handler. For testing, I got rid of all the Promise stuff and just have a simple getJSON call inside the model which consoles out from the ‘done’ and ‘fail’ handlers and it always goes to the ‘fail’.


I changed my stub JSON to just { ‘key’:‘val’ } and the basic getJSON works, so now am looking into why my other test JSON is a problem.


It took a while but I found my issue. In my big test JSON, I had ‘"@TimeStamp": Date.create().toISOString()’, which prolly fails in the new version becasue it can’t make the ‘Date.create()’ call for some reason. In my small test JSON, I had ‘"@TimeStamp": ‘2015-04-03’’, which prolly failed becasue it doesn’t like the mix of single quote & double quote.