Results 1 to 2 of 2

Thread: External Config file Issue

  1. #1
    Sencha Premium Member
    Join Date
    Sep 2012
    Location
    Singapore
    Posts
    54
    Answers
    3

    Question Answered: External Config file Issue

    Hi,

    I've a Config.js which is needed in my app which I've included in the Resources in SA project.

    Code:
    Ext.define('MyApp.Config', {
        statics: {
            baseUrl:'http://localhost/ws/public/'
        }
    });
    The application works fine using preview in SA.

    I wanted to create a build and have the Config.js excluded from being bundle in app.js. This is so that I can change the config easily.

    My problem is that every time I create a build, I couldn't run as I got an error.
    Uncaught TypeError: Ext.define is not a function
    at Config.js?_dc=1490690335498:1
    I notice in the minified app.json
    .....,"js":[{"path":"Config.js"},{"path":"app.js"}]....
    Config.js got loaded before app.js. This cause the Ext.define not valid

    I reverse the order
    .....,"js":[{"path":"app.js"},{"path":"Config.js"}]....
    This time no error and I am able to run the app succesfullly.

    Question:
    1. What do I set in SA to ensure that Config.js gets loaded last?
    requireSdk suppose to set the class to be compile after but it doesn't work
    Screen Shot 2017-03-28 at 5.13.59 PM.png
    2. Is there any other better way to define configuration for the Application?

    Any feedback will be very much appreciated.

  2. Hello

    It' a bug DSGNR-7701 the requireSdk should be requiresSdk to work with the latest Cmd versions.


    The problem is that if you rename the requireSdk to the requiresSdk in the app.json SA will rename it again on that resource. The only solution before fix will be released in SA is to move the config file outside of the SA interface and set it manually in the app.json with the correct config requiresSdk: true

    If you edit the app.json outside of SA and you do not change the configs added by SA, SA will not mess up with them.

    In regards to the config file, this is interesting https://www.sencha.com/forum/showthread.php?170850-Create-a-config-file

    Let me know if any other questions
    Thanks
    Petr

  3. #2
    Sencha User
    Join Date
    Sep 2014
    Location
    Central Europe
    Posts
    795
    Answers
    103

    Default

    Hello

    It' a bug DSGNR-7701 the requireSdk should be requiresSdk to work with the latest Cmd versions.


    The problem is that if you rename the requireSdk to the requiresSdk in the app.json SA will rename it again on that resource. The only solution before fix will be released in SA is to move the config file outside of the SA interface and set it manually in the app.json with the correct config requiresSdk: true

    If you edit the app.json outside of SA and you do not change the configs added by SA, SA will not mess up with them.

    In regards to the config file, this is interesting https://www.sencha.com/forum/showthread.php?170850-Create-a-config-file

    Let me know if any other questions
    Thanks
    Petr

Similar Threads

  1. Replies: 0
    Last Post: 5 Oct 2014, 8:56 AM
  2. Replies: 0
    Last Post: 5 Oct 2014, 8:56 AM
  3. External js file
    By Pooja0209 in forum Sencha Touch 2.x: Q&A
    Replies: 1
    Last Post: 4 Sep 2012, 10:02 AM
  4. Loading tree with external json file on local file system
    By sogo in forum Community Discussion
    Replies: 1
    Last Post: 8 Oct 2010, 4:03 AM

Posting Permissions

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