samedi 5 décembre 2015

Ember Cannot read property 'path' of undefined

I keep hitting this error and am pretty stumped as to why. I can't trace the error in dev tools back to anything in my primary JS file. My Ember-related code is as follow:

  var App = Ember.Application.create();
  App.ApplicationRoute = Ember.Route.extend({
    model: function() {
      var url = 'http://ift.tt/1TszUj2';
      return Ember.$.getJSON(url).then(function(data) {
        model = {
          list1: data
        };
        return model;
      });
    }
  });

  Ember.Handlebars.helper('autocomplete', Ember.View.extend({
    templateName: 'controls/autocomplete',

    filteredList: function() {
      ...
      }

      return list.filter(function(item) {
        ...
      });
    }.property('list.@each', 'filter')
  }));

I have removed app-specific code from the structure there. Any time I try to run this I get the following error:

Ember Cannot read property 'path' of undefined which looks to be coming from my ember.min.js file. Any help tracking this down would be great.

Codepen Demo Link

EDIT When running this code locally and not in CodePen I end up with the following errors:

Uncaught TypeError: Cannot read property 'extend' of undefined which looks to be thrown by Ember.View.extend

and

Uncaught TypeError: Cannot read property 'isHelperFactory' of undefined which is coming from the ember.min file.




Aucun commentaire:

Enregistrer un commentaire