Results 1 to 2 of 2

Thread: "sencha app build production" Ext.Loader] Failed loading

  1. #1
    Sencha User bluehipy's Avatar
    Join Date
    Mar 2010
    Location
    Romania
    Posts
    623
    Vote Rating
    29
      0  

    Default "sencha app build production" Ext.Loader] Failed loading

    The error I am talking about is:
    Code:
    [ERROR] Error thown from your application with message: Error: [Ext.Loader] Failed loading 'sdk/src/data/reader/Array.js', please verify that the file exists
    In dev mode everything works just fine but when you try to compile things, in Sencha Touch 2 projects, with both Windows versions of SDK Tools, command ends like in the upper snippet.

    After many hours I spotted my problem. Maybe yours is the same.

    My application is making use of an authenticatiob api, using Oauth2, so in the early stages, like in application launch, I am checing if the application has an access_token or I have to obtain a new one. That is happening by redirectig the browser to some other url. And this is the point where the sencha sdk tools crash.

    Solution was simple for me, it was enough to delay the eventually redirection some milliseconds, and move it out from launch method.
    Code:
     launch: function() {
            window.FB= this.getController('FB');
            // Destroy the #appLoadingIndicator element
            Ext.fly('appLoadingIndicator').destroy();
            Ext.defer(Ext.bind(this.later,this),200);       
        },
        later:function()
        {
            this.nav = Ext.Viewport.add({xtype:'navigationview'});
    
    
            var params = Ext.Object.fromQueryString(window.location.hash.substr(1));
            if(!params.access_token)
            {
                //init authentication
                FB.authenticate();
            }        
        }
    so better keep the launch method lite and defer the other initialisations otherway the sdk tools might cause you frustrations

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,421
    Vote Rating
    1271
      0  

    Default

    Little more performant version (food for thought):

    launch : function() {
    var me = this;

    ...

    setTimeout(function() {
    me.later.call(me);
    }, 200);
    },

    later : function() {
    ...
    }
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •