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

      0  

    Default Errors after compiling

    Errors after compiling


    Hi everyone. I compiled my project via sencha cmd 3.0.0.230. After compile i navigate to http://meprojectlocalhost.com, but my project not rendering and console of browser displays following errors:

    Code:
    • Uncaught Error: [Ext.Loader] Failed loading 'MyApp/model/MyModel1.js', please verify that the file exists all-classes.js:10092
    • Uncaught Error: [Ext.Loader] Failed loading 'MyApp/store/MyStore1.js', please verify that the file exists
    and etc. on all my models and stores. Please note what next address http://myprojectlocalhost.com/MyApp/model/MyModel1.js?_dc=1357902265764
    where MyApp is namespace my project (ie example MyApp.model.Model1)

    All models and stores in file all-classes.js is. Below code my app.js in all-classes.js/

    PHP Code:
    Ext.Loader.setConfig({    enabledfalse,    paths: {        'Ext''js/extjs4/src',        'Ext.ux''js/extjs4/ux',        'MyApp''/js/gisjs'    }});

    Ext.require('Ext.layout.*');Ext.require('MyApp.controller.*');Ext.require('MyApp.store.*');Ext.require('MyApp.model.*');


    Ext.application({    name'MyApp',    appFolder'/app',    controllers: ['MyController'],    autoCreateViewportfalse,    launch: function() {        var access this.getController('Main').accsesData;        Ext.create('MyApp.view.Viewport', {            accessaccess        });        Ext.QuickTips.init();    }}); 
    I tried comment out setConfig and Ext.require, but failure. Once i remove stores from my controller errors disappear. Version of the ExtJS is 4.1.1a.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,543
    Vote Rating
    873
    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


    Your stores use the models so they should require the models.
    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
    7
    Vote Rating
    0
    likdike is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    Your stores use the models so they should require the models.
    I add to config of stores the following line
    PHP Code:
    requires: ['MyApp.model.MyModel1'
    and errors associated with the models disappeared, but similar errors associated with stores remained
    HTML Code:
    Uncaught Error: [Ext.Loader] Failed loading 'MyApp/store/MyStore1.js', please verify that the file exists

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,543
    Vote Rating
    873
    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


    Ok, so the classes that use the store needs to require the store. You can see a pattern forming here where if class A uses class B at all you should require class B in class A.
    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.

  5. #5
    Sencha User
    Join Date
    Dec 2012
    Posts
    7
    Vote Rating
    0
    likdike is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    Ok, so the classes that use the store needs to require the store. You can see a pattern forming here where if class A uses class B at all you should require class B in class A.
    Such variant i tried, but without result. Interestingly that if Ext tries to load stores dynamically, why it appeals to myproject.com/MyApp/store/MyStore.js, when it should to appeal to myproject.com/app/store/MyStore.js, look my app.js. Is not there or something I do not understand?

  6. #6
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,543
    Vote Rating
    873
    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


    It should try and load from /js/gisjs/store/MyStore.js as you have a path for MyApp to /js/gisjs. Did you update the bootstrap.js file at all? I ask because you are using the wildcards which I'm not a fan of but should technically work.
    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.

  7. #7
    Sencha User
    Join Date
    Dec 2012
    Posts
    7
    Vote Rating
    0
    likdike is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    It should try and load from /js/gisjs/store/MyStore.js as you have a path for MyApp to /js/gisjs. Did you update the bootstrap.js file at all? I ask because you are using the wildcards which I'm not a fan of but should technically work.
    Sorry, is all right /js/gisjs. Yes, i update the bootstrap.js file. Please you look at my steps, maybe i do something wrong?

    #1
    Code:
    sencha compile -classpath=gisjs meta -alias -out build/bootstrap.js and meta -alt -append -out build/bootstrap.js and meta -loader -append -out build/bootstrap.js
    #2
    The gotten file bootstrap.js i add to my index.html
    Code:
    <!-- <x-compile> -->
              <!-- <x-bootstrap> -->
              <script src="extjs4/ext-dev.js" type="text/javascript"></script>
              <script src="build/bootstrap.js" type="text/javascript"></script>
              <!-- </x-bootstrap> -->
    
    
                <script src="gisjs/app.js" type="text/javascript"></script>
            <!-- </x-compile> -->
    #3
    Code:
    sencha -debug compile -classpath=extjs4/src,extjs4/ux,gisjs page -i index.html -o build/index.html

  8. #8
    Sencha User
    Join Date
    Dec 2012
    Posts
    7
    Vote Rating
    0
    likdike is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    It should try and load from /js/gisjs/store/MyStore.js as you have a path for MyApp to /js/gisjs. Did you update the bootstrap.js file at all? I ask because you are using the wildcards which I'm not a fan of but should technically work.
    The problem is not solved. One more the question, properly i understand what after compiling the contents of bootstrap.js file should be in add-classes.js? I ask because i do not find it there.

Thread Participants: 1

Tags for this Thread