Hybrid View

  1. #1
    Sencha Premium Member krullj's Avatar
    Join Date
    Sep 2011
    Posts
    35
    Vote Rating
    7
    krullj is on a distinguished road

      2  

    Default SenchaCmd 3.0.0.250 issues with Ext.Loader

    SenchaCmd 3.0.0.250 issues with Ext.Loader


    This problem has been solved. Solution in Post #6.

    In short, my application works great with Ext.Loader enabled but not built. However, after disabling Ext.Loader and building my application, it continues to try and load every file that has already been defined in single file that SenchaCmd compiled. It tries to load all of the files with an incorrect path and thus fails.

    How can I stop my built, single js file from using Ext.Loader to load all of my classes? All of the classes are already defined in the single js file, but Loader doesn't seem to either notice or care that literally the entire application has already been loaded.

    Here's what's happening in Firebug (this is a snippet... it goes on for much longer):
    Code:
    Error: [Ext.Loader] Failed loading 'NS/controller/Authentication.js', please verify that the file existsError: [Ext.Loader] Failed loading 'NS/controller/User.js', please verify that the file exists
    Error: [Ext.Loader] Failed loading 'NS/store/Users.js', please verify that the file exists
    Error: [Ext.Loader] Failed loading 'NS/view/UserEditor.js', please verify that the file exists
    I don't know why it's using NS as the path, as that should have translated to "app".

    I have been working on this for days and any help would be appreciated. Thanks!
    Last edited by krullj; 3 Dec 2012 at 9:23 AM. Reason: Used "However" too many times.

  2. #2
    Sencha User pcr's Avatar
    Join Date
    Jun 2009
    Posts
    183
    Vote Rating
    2
    pcr is on a distinguished road

      0  

    Default Need more code

    Need more code


    Just to investigate your problem please post the app.js code.

  3. #3
    Touch Premium Member
    Join Date
    Aug 2011
    Location
    Houston, TX
    Posts
    5
    Vote Rating
    1
    Darren Pruitt is on a distinguished road

      0  

    Default


    Make sure the single file really has all of the classes in it. I just had an issue recently where only the Views were getting combined into the single file and the loader was trying to load each individual Controller file. None of the controllers, stores or models were compiled into the single file.

    Between all the stuff I tried I think the two things that worked were:

    Refreshing the bootstrap.js:

    Code:
    sencha app refresh
    And I had to include the app.js in the compile:

    Code:
    sencha compile -classpath=ext/src,app,resources,app.js 
        page -name=page -in index.html -out=deploy/index.html 
        and restore page 
        and exclude -file ext/src
        and concat deploy/appClasses.js
    This compiled all the app only files into the single appClasses.js and the loader worked fine after that.

  4. #4
    Sencha Premium Member krullj's Avatar
    Join Date
    Sep 2011
    Posts
    35
    Vote Rating
    7
    krullj is on a distinguished road

      0  

    Default


    Thank you for the responses.

    In terms of using
    Code:
    sencha app refresh
    I am unable to do that as the application was not initially created with SenchaCmd. If there's a way to force the refresh, I'm not sure how to do it.

    I did try creating a bootstrap.js file manually by using the following code:
    Code:
    sencha compile --classpath=ext/src,ext/examples/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
    But when using the bootstrap it never seemed to make a difference error-wise. Ext.Loader was still trying to load all of the classes that were already defined in the single built js file. Maybe I'm building the bootstrap incorrectly; that I'm not sure of.

    As far as I can tell, every view, controller, model, etc are listed in the single built js file, including the ones that it tries to load.

  5. #5
    Sencha User pcr's Avatar
    Join Date
    Jun 2009
    Posts
    183
    Vote Rating
    2
    pcr is on a distinguished road

      0  

    Default Recreate app with CMD

    Recreate app with CMD


    I had an app not created by CMD. So I recognise the problem build the app. I generated an with the same name and copied all js, css, html, custom pics etc into the new empty app. After that I had no more problems with run CMD commands on the app. Be aware of that generate an app with the same name could overwrite the old one. So move the old app to another map before generate an empty new with the same name.

  6. #6
    Sencha Premium Member krullj's Avatar
    Join Date
    Sep 2011
    Posts
    35
    Vote Rating
    7
    krullj is on a distinguished road

      1  

    Default Fixed It

    Fixed It


    I finally found the solution to be, in my case, this:
    Code:
    sencha compile --classpath=ext/src,ext/examples/ux,app/model,app/store,app/view,app/controller,app/app.js union -recursive -file app/app.js concat all-classes.js
    Essentially, I specified the order of the class files and put the "controller" folder at the end. I honestly hope there is a better solution than this, but it worked for me.