1

I'm struggling to get DeftJs working with Sencha Cmd. At first I suspected Cmd 4, but I've also tried with Cmd 3 with exactly the same result, so I reckon I'm just missing something.

I'm getting the error "Cannot set property 'instance' of undefined" when Ext.onReady() is being called. Ext.app.Application is not being defined when it should be:

Ext.onReady(function() {
    // this won't be called until App has been created and its requires have been met...
    Ext.app.Application.instance = new App(); // Ext.app.Application is undefined.
});

I am following the instructions for Using Sencha Cmd (with DeftJs 0.9+ only) at https://github.com/deftjs/DeftJS/wiki/Adding-Deft-JS-to-Your-Application#using-sencha-cmd-with-deft-js-09-only

Would be very grateful for any clues as to what's going wrong.

Matt Jenkins
  • 2,824
  • 1
  • 30
  • 34
  • Did you check the **Phoenix-Cmd** reference app on github? I had no problems with Sencha Cmd after checking this [example](https://github.com/deftjs/Examples/tree/master/phoenix-cmd) – AlperG Nov 13 '13 at 16:22

1 Answers1

0

In your Application.js file (found in the app folder of your project) make sure you include Ext.app.Application in your requires.

Ext.define("Phoenix.Application", {
  extend: "Deft.mvc.Application",
  requires: [
    "Deft.mixin.Controllable",
    "Deft.mixin.Injectable",
    // other required files,
    "Ext.app.Application" // <=========== HERE'S THE MISSING PIECE
  ],

  init: function() {
    this.beforeInit();
    Deft.Injector.configure(this.buildInjectorConfiguration());
    //Deft.promise.Deferred.enableLogging = false;
    return this.afterInit();
  },

  // other startup code
});
Brian Wendt
  • 83
  • 1
  • 6