mardi 13 octobre 2015

router undefined in production build

I created a new Ember-cli app (using versions 2.1 of Ember and Ember Data). It runs fine on the dev server, but in order to use it as a front-end to a WordPress app, I'm using the production builds for development of the WordPress. i.e. I'm running Ember build and linking vendor.js and myemberapp.js into the WordPress site on my localhost. When I run the WordPress site locally, I get this error in my console for Ember

"Cannot read property 'startRouting' of undefined"

Here, undefined refers to the router. ember.debug.js:3583 links to the startRouting function

  startRouting: function(){
     var router = +emberMetalProperty_get.get(this, 'router');
     router.startRouting(isResolverModuleBased(this);
     this._didSetupRouter = true;
  }

Also, in the function called before that funtion is didBecomeReady. I'm assuming that's somehow related to the DOM being ready but it's not entirely clear from the source.

No other errors like this on google...

Question: why might the router be undefined in the production build?

                Versions: Ember : 2.1.0
                Ember Data : 2.1.0
                JQuery: 1.11.3




Aucun commentaire:

Enregistrer un commentaire