1. #11
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    108
    Answers
    4
    Vote Rating
    1
    paulh1971 is on a distinguished road

      0  

    Default


    Well, some how I finally got the production build to work. I did some various cleanup on some files and now it works. I wish I knew what made it work so it could help someone else.

  2. #12
    Sencha User
    Join Date
    Jun 2012
    Posts
    2
    Vote Rating
    0
    rfdigital is on a distinguished road

      0  

    Default totally stumped

    totally stumped



    paulh1971 I would be very interested to know what you did to get around this one...

    referencing either testing.js or production.js for the microloader results in the following when doing 'sencha app build production':

    TypeError: 'undefined' is not a function
    phantomjs://webpage.evaluate():7
    phantomjs://webpage.evaluate():1
    ../sdk/command/vendor/phantomjs/dependencies.js:36

    how does one go about debugging or gaining more clues on the build process?
    (referencing development.js works)

    Looks like this same issue is being discussed here:
    http://www.sencha.com/forum/showthre...not-a-function

  3. #13
    Sencha User
    Join Date
    Jun 2012
    Posts
    9
    Answers
    1
    Vote Rating
    0
    fatangare is on a distinguished road

      0  

    Default


    SDK version? Did you get any example in SDK in working state with production.js?

  4. #14
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    108
    Answers
    4
    Vote Rating
    1
    paulh1971 is on a distinguished road

      0  

    Default


    Hi rfdigital,

    I couldn't get the production build to work even with development.js. Then I finally got that to work. At that point I didn't think about trying production.js again. Since you mentioned it, I just went and tried it. I am still getting the same errors you are. So not sure how to get around that because I know there are no javascript errors, because I have gone through the whole web app with the Google Chrome console and it is all clean. Also with the error, it said it failed to load application from file:///c:/inetpub/wwwroot/.... and to try setting the absolute url to my application for the url item inside app.json. I did that, but still got the error. Not sure if it is a bug or not, and not sure if it is really the right thing to do to leave it with development.js, but the web app is working great.

    Hopefully someone from the development team can shed some light on this.

  5. #15
    Sencha User
    Join Date
    Jun 2012
    Posts
    9
    Answers
    1
    Vote Rating
    0
    fatangare is on a distinguished road

      0  

    Default it must be bug!

    it must be bug!


    Well, I tried sencha app create xyz ./xyz command to create new sencha application. Then I just change development.js to production.js. And I got the error. So it means it must be bug. I can get same error if I use testing.js, too.

    Sencha development team,
    Will you please confirm it?
    SDK: 2.0.1.1
    Tool: SenchaSDKTools-2.0.0-beta3

  6. #16
    Sencha User
    Join Date
    Jul 2012
    Posts
    7
    Vote Rating
    0
    Nam Nguyen is on a distinguished road

      0  

    Default


    I'm getting exactly the same bug. I can make a build with the development.js microloader, but then tap events stops working in my build.

    Curious to see if its a bug!

  7. #17
    Sencha User
    Join Date
    Aug 2012
    Posts
    2
    Vote Rating
    0
    ElasticRuffe is on a distinguished road

      0  

    Default Same issue, steps to re-produce

    Same issue, steps to re-produce


    Hi,

    As fatangare stated, this issue indeed exists even with the initial application created with Sencha command line tools. Here are the steps to re-produce the build error:
    1. Have the latest SDK version (2.0.1.1) and the latest SDK tools version (2.0.0 beta 3 for Mac) installed.
    2. Create a new app while in the SDK folder:
      Code:
      sencha app create -n TestApp -p ~/Sites/TestApp
      Yes, as you can see, I'm using the OS X Sites folder so that the app is hosted locally at http://localhost/~username/TestApp
    3. Edit the index.html of the newly created app and replace the Microloader JS file with the production version:
      Code:
      <script id="microloader" type="text/javascript" src="sdk/microloader/production.js"></script>
      I assume that this is a required step, even though it's poorly documented.
    4. Build the app (the app folder is the working folder):
      Code:
      sencha app build -e production
    5. You get the build error:
      Code:
      [INFO] Deploying your application to /Users/XXXX/Sites/TestApp/build/production[INFO] Copied sdk/sencha-touch.js
      [INFO] Copied app.js
      [INFO] Copied resources/css/app.css
      [INFO] Copied resources/images
      [INFO] Copied resources/icons
      [INFO] Copied resources/startup
      [INFO] Resolving your application dependencies (file:////Users/XXXX/Sites/TestApp/index.html)
      [ERROR] TypeError: 'undefined' is not a function
      
      
        phantomjs://webpage.evaluate():7
        phantomjs://webpage.evaluate():1
        /Users/XXXX/Sites/TestApp/sdk/command/vendor/phantomjs/dependencies.js:36
      Timeout waiting for the application to finish loading
      [ERROR] Failed loading your application from: 'file:////Users/XXXX/Sites/TestApp/index.html'. Try setting the absolute URL to your application for the 'url' item inside 'app.json'
      You can even do what the error message suggest, and set the "url" item in app.json to http://localhost/~XXXX/TestApp/index.html but it won't help.
    My guess is that the production.js version of Microloader is still loading content when the dependency resolver thinks that the page is fully loaded. I made some debugging and it seems that in those lines in dependencies.js the Ext object is just a dummy object and has no onReady method (which causes the exception). This suggests that the sencha-touch.js was not loaded yet.

    EDIT: I tried to examine this issue further, and it seems that you actually should not replace the Microloader development.js with production.js. The build process seems to do that automatically. The script injected to the final index.html seems to match the production.js (at least it does not match development.js). This way the build can be finished successfully, but more issues occur when trying to open the produced app. The page (by default available at http://localhost/~username/TestApp/b...ion/index.html) fails because of the following error:

    http://localhost/~XXXXX/TestApp/build/production/src/log/Logger.js?_dc=1344587694338 404 (Not Found)
    • Uncaught Error: [Ext.Loader] Failed loading 'src/log/Logger.js', please verify that the file exists
      • Ext.apply.onFileLoadError:1
      • Ext.Function.pass:1
      • Ext.apply.loadScriptFile.t:1
      • Ext.apply.injectScriptElement.r
    I personally find this very concerning, as my conclusion is that at the moment you cannot build your app for production. Our team was about to release our application for production, but now it seems that we cannot do that. I'm also quite surprised how this kind of issue can occur even with the basic example app. If anyone has any suggestions how this could be resolved I'd love to hear them.
    Last edited by ElasticRuffe; 10 Aug 2012 at 12:38 AM. Reason: Further examination about the issue

  8. #18
    Sencha User
    Join Date
    Jun 2012
    Posts
    1
    Vote Rating
    0
    koolshiva is on a distinguished road

      0  

    Default Regarding the new keyword

    Regarding the new keyword


    Sorry to restart the thread here, but it is related. I saw it being mentioned that the new keyword must not be used in production building the sencha touch app. Unfortunately, I am forced to use it when integrating a sencha touch chart with my sencha touch application. Is it allowed in this scenario or should be changed? If so, is there a different way of creating the touch chart (without new keyword).

    My code snippet is as follows:

    var chartPanel = new Ext.chart.Chart({
    themeCls: 'pie1',
    theme: 'Demo',
    store: 'myViewChart',
    shadow: false, ... and so on

    Thanks in advance.