1. #1
    Sencha User
    Join Date
    Dec 2012
    Posts
    2
    Vote Rating
    0
    mpal is on a distinguished road

      0  

    Default Unanswered: Sencha Touch 2.1 build generates a non-working app

    Unanswered: Sencha Touch 2.1 build generates a non-working app


    Hi,

    I've developed a Sencha Touch 2.1 app which runs fine without errors or warnings on development. Using Sencha Cmd 3.0.0.250, I'm also able to build my app without any kind of error (for the record I'm using the skip.sass option because my CSS is already generated). However, the generated build just doesn't work. The app crashes when doing the initial loading and shows the following Javascript error on Chrome:

    Code:
    
    
    Uncaught TypeError: Object function Window() { [native code] } has no method 'apply' app.js:4962
    Class app.js:4962
    (anonymous function) app.js:77167
    and Safari:

    Code:
    
    TypeError: 'undefined' is not a function (evaluating 'this.constructor.apply(this, arguments)')
    
    I've tried building my app on testing, production and package modes but none generate a working application.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,801
    Answers
    3467
    Vote Rating
    834
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    I just generated an app:

    cd /path/to/sencha-touch-2.1.0-gpl/
    sencha generate app MyApp ../MyApp

    and did a build:

    cd ../MyApp
    sencha app build testing

    and launched that build and it worked with no issue for me.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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.

  3. #3
    Sencha User
    Join Date
    Dec 2012
    Posts
    2
    Vote Rating
    0
    mpal is on a distinguished road

      0  

    Default


    Thanks for your answer Mitchell,

    that works for me too (already tried that). I've found the solution to the problem debugging the generated app.js. Just in case anyone is having a similar issue I'll leave the root of the problem and the solution here. Turns out that there was a missing ";" at the end of a model definition file. I had a model "Section" defined in a file app/model/Section.js like this:

    Code:
    Ext.define('MyApp.model.Section',{
        extend:'Ext.data.Model',
        
        config:{
            fields:[
                /*the fields*/
            ]
        }
    })
    This works fine while testing but when you build the app, Sencha Cmd (production,testing or package) concatenates this file with the rest of the files into app.js, resulting in an invalid javascript code. The solution is to make sure that every .js file is properly ended by a semicolon (";"):

    Code:
    Ext.define('MyApp.model.Section',{
        extend:'Ext.data.Model',
        
        config:{
            fields:[
                /*the fields*/
            ]
        }
    });

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi