1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    22
    Vote Rating
    0
    mariovde is on a distinguished road

      0  

    Default Unanswered: Application debugs without errors, but throws Undefined when running as Prod Build

    Unanswered: Application debugs without errors, but throws Undefined when running as Prod Build


    Hi all,

    I have an application running in the browser, debug is on.
    No errors, everything runs as it should.

    In one of my controllers, I use:

    Code:
    init : function () {
    	    // every controller has getters for its stores.
    	    // For store UsersStore getter would be getUsersStoreStore()
    		console.log("store: ");
    		console.log(this.getCarousselsStore());
    	    this.getCarousselsStore().addListener('finishedLoading',this.carousselLoadHandler, this);    
    }
    this makes sure that when a store is loaded, it throws an event that I pick up.
    I set the listener in the inititialize of my homepage controller.
    This work perfect in debug mode

    But when running the application as a Package or Production build, I get an error on that line, that says
    TypeError: 'undefined' is not a function (evaluating 'this.getCarousselsStore()')

    Is there a sequence in how the app is loaded:

    first requires, then stores, than controllers etc... and when are they instantiated? When app.js loads?

    Thanks for the help!

    Mario

  2. #2
    Sencha User
    Join Date
    Jun 2012
    Posts
    22
    Vote Rating
    0
    mariovde is on a distinguished road

      0  

    Default


    Update: apparently if I use Ext.getStore('storename').addEventlistener... it works.

    Maybe they removed this feature in 2.0.1.1

  3. #3
    Sencha User
    Join Date
    Jun 2012
    Posts
    22
    Vote Rating
    0
    mariovde is on a distinguished road

      0  

    Default


    Update 2:

    other functionalities like adding custom attributes to a class works fine in debugger but not in a production or package build.

    for example.

    if I add "buttonIndex" to as a custom config property and later want to reference it in a function triggerd by the tap-event I get an "undefined". Yet this works in Debug.

    In debug, I can reference it like this: (and this works, but not in release build)

    handleTap : function (button, e, eopts)
    {
    console.log(button.buttonIndex)
    }