Hybrid View

  1. #1
    Touch Premium Member
    Join Date
    Aug 2011
    Posts
    96
    Vote Rating
    6
    abcoa is on a distinguished road

      0  

    Default SenchaCmd 3.0.0.190 issues with Ext.Loader

    SenchaCmd 3.0.0.190 issues with Ext.Loader


    I have a Sencha Architect 2.1 (SA21) project that I am trying to compile with SenchaCmd.
    The structure of the project is as following:
    Code:
    /app
    /lib
        /extjs
        /ux
    /build
        /index.html
        /myapp-all-debug-w-comments.js
        /myapp-all-debug.js
        /myapp-all.js
    /bootstrap.js
    /app.js
    /app.html
    /index.html

    Project loads fine with both app.html and index.html.
    index.html uses ext-dev.js and has all the necessary directives for compiling (as app.html is reserved by SA21). See below for index.html


    The problem is 2 fold.


    Problem #1
    ---------------------------
    1) When I generate bootrstrap.js and use it in index.html I get bunch of loading errors. If I comment out bootstrap.js, everything works ok. Here is the command I use to generate bootrstap.js
    Code:
    sencha compile -classpath=lib/extjs/src,lib/ux,app,app.js ^
        meta -loader-paths -base-path . -out bootstrap.js and ^
        meta -alternates -append -out bootstrap.js and ^
        meta -alias -append -out bootstrap.js and ^
        meta -manifest -out manifest.json and ^
        meta -filenames -json -out filenames.json
    Th errors I get are a bunch of Ext.Loader issues with following format:
    Code:
    Uncaught Error: [Ext.Loader] Failed loading 'app/controller/MyAppControllerOne.js/model/account/Index.js', please verify that the file exists 
    Uncaught Error: [Ext.Loader] Failed loading 'app/controller/MyAppControllerOne.js/view/account/Index.js', please verify that the file exists
    Notice the path!? It does not make sense and I am not sure where it is getting this path.
    The bootstrap.js file that is generated has correct paths (among many) for all files reported in the error console.
    It looks proper to me:
    Code:
    Ext.Loader.addClassPathMappings({
    ...
    "MyApp.controller.MyAppControllerOne": "app/controller/MyAppControllerOne.js",
    ...
    "MyApp.model.account.Index": "app/model/account/Index.js",
    ...
    "MyApp.view.account.Index": "app/view/account/Index.js",
    Any idea what I am doing wrong here?


    Problem #2
    ---------------------------
    2) After compiling the app and using "all-in-one" generated JS file, I am still getting loader errors. I use following command to generate build files
    Code:
    sencha compile -classpath=lib/extjs/src,lib/ux,app,app.js -ignore=./bootstrap.js ^
        concat build/myapp-all-debug-w-comments.js and ^
        -options debug:true concat -strip-comments build/myap-all-debug.js and ^
        -options debug:false concat -yui build/myap-all.js

    The problem is again related to loader. The fact is, loader is supposed to be disabled here (documentation specifies that Ext.Loader is disabled by default)! But according to messages, it is not.
    I breifly modified -debug file and added
    Code:
    Ext.Loader.setConfig({
        enabled: false
    });
    but some files still fail to load.
    What I don't understand is why these files are being even looked by by loader when all classes and now in single file.I included "production" index.html that I used












    /index.html
    Code:
    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="utf-8">
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
            <meta name="viewport" content="width=device-width, initial-scale=1.0">
            <title>MyApp</title>    
            <link rel="stylesheet" type="text/css" href="lib/extjs/resources/css/ext-all.css" />
            <link rel="stylesheet" type="text/css" href="resources/css/app.css" />        
            <!-- <x-compile> -->
                <!-- <x-bootstrap> -->
                <script type="text/javascript" src="lib/extjs/ext-dev.js"></script>
                <script type="text/javascript" src="bootstrap.js"></script>
                <!-- </x-bootstrap> -->
                <script type="text/javascript" src="app.js"></script>
            <!-- </x-compile> -->                 
        </head>
        <body>
            <div id="loading-mask"></div>
            <div id="loading">
                <div class="loading-indicator">
                    Loading...
                </div>
            </div>
        </body>
    </html>



    /build/index.html
    Code:
    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="utf-8">
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
            <meta name="viewport" content="width=device-width, initial-scale=1.0">
            <title>MyApp</title>    
            <link rel="stylesheet" type="text/css" href="../lib/extjs/resources/css/ext-all.css" />
            <link rel="stylesheet" type="text/css" href="../resources/css/app.css" />        
    <script type="text/javascript" src="myapp-all-debug.js"></script>
        </head>
        <body>
            <div id="loading-mask"></div>
            <div id="loading">
                <div class="loading-indicator">
                    Loading...
                </div>
            </div>
        </body>
    </html>

  2. #2
    Sencha User
    Join Date
    Oct 2010
    Posts
    75
    Vote Rating
    4
    devnullable is on a distinguished road

      0  

    Default


    Hi!

    I have been trying to get some attention from Sencha side but no success so far...

    Anyway you can find temporary fix for the bug:

    http://www.sencha.com/forum/showthre...l=1#post897523

  3. #3
    Touch Premium Member
    Join Date
    Aug 2011
    Posts
    96
    Vote Rating
    6
    abcoa is on a distinguished road

      0  

    Default


    The issue you describe in your linked thread is exactly what I am experiencing as well, but your proposed fix (commenting out if statement block on line 392 of ./src/core/src/class/Loader.js) did not work for me... BTW, I am using ext js 4.1.2a

  4. #4
    Sencha User
    Join Date
    Oct 2010
    Posts
    75
    Vote Rating
    4
    devnullable is on a distinguished road

      0  

    Default


    Hi!

    In case of your problem #1 you should comment it out in lib/extjs/ext-dev.js because that is the file that default index.html is using.

  5. #5
    Touch Premium Member
    Join Date
    Aug 2011
    Posts
    96
    Vote Rating
    6
    abcoa is on a distinguished road

      0  

    Default


    I did that too, and am still getting errors.
    [Ext.Loader] Failed loading 'Ext/app/Application.js'

  6. #6
    Sencha User
    Join Date
    Oct 2010
    Posts
    75
    Vote Rating
    4
    devnullable is on a distinguished road

      0  

    Default


    I don't use Sencha Architect so I cannot help with that. Instead I have generate app with command sencha app generate which makes little bit different directory structure.

    How about if you use command sencha app refresh? That should update the bootstrap.js file.

    This Sencha Cmd 3 is more or less a moving target so it is not easy to keep yourself up to date

  7. #7
    Touch Premium Member
    Join Date
    Aug 2011
    Posts
    96
    Vote Rating
    6
    abcoa is on a distinguished road

      0  

    Default


    I just tested this with SenchaCmd 3.0 GA (3.0.0.250) and with Ext JS 4.1.3.

    - Problem #1 no longer occurs, so that is fixed.
    - Problem #2 is still there though....

  8. #8
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,386
    Vote Rating
    138
    dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold

      0  

    Default


    Can you run with the "-debug" switch and include the full log here? (Please include the exact command you run as well).
    Don Griffin
    Engineering Manager - Frameworks (Ext JS / Sencha Touch)

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"