Results 1 to 3 of 3

Thread: Production Build Failing

  1. #1
    Sencha Premium Member
    Join Date
    Jul 2014
    Location
    Bakersfield CA
    Posts
    81
    Answers
    3

    Default Production Build Failing

    I have a Small CRUD application that is fairly complex because it must pull all the data down into a local WebSQL Database and run stand-alone without any Network, then when a network is available, the data entries are manually (button press) replicated back to the Server.

    I have ran a build for Test, and it works runs fine. When I run a build for Production, it will not load my external classes, but instead burps at loading the Touch Classes
    Code:
     Document was loaded from Application Cache with manifest http://localhost:1843/cache.appcache
    (index):1 Application Cache Checking event
    (index):1 Application Cache Downloading event
    (index):1 Application Cache Progress event (0 of 2) http://localhost:1843/index.html
    (index):1 Application Cache Progress event (1 of 2) http://localhost:1843/
    app.js:1 Uncaught TypeError: Cannot read property 'log' of undefinedapp.js:1 
    anonymous function)           app.js:1 
    Ext.ClassManager.create.k   app.js:1 
    (anonymous function)           app.js:1 
    Ext.ClassManager.create.k    app.js:1 
    Ext.ClassManager.create       app.js:1 
    Ext.apply.onBeforeCreated   app.js:1 
    Ext.apply.process.h               app.js:1 
    Ext.apply.process.h               app.js:1 
    Ext.apply.process.h               app.js:1 
    Ext.apply.process.h               app.js:1 
    Ext.apply.process.h               app.js:1 
    Ext.apply.process                  app.js:1 
    Ext.Class.b                            app.js:1 
    Ext.ClassManager.create      app.js:1 
    Ext.apply.define                    app.js:1 (anonymous function)
    (index):1 Application Cache Progress event (2 of 2) 
    (index):1 Application Cache UpdateReady event
    app.js:1 Uncaught TypeError: Cannot read property 'log' of undefined    app.js:1 (anonymous function)
    The classes that load next would normally be the external classes, and then the application. Can I get the help of a build expert please?

    Here is the Build Log File without any changes to production.defaults.properties file

    Here is the Build Log File after making changes recommended by Don Griffin in this post.

    Here is the output of the Browser after the changes to the production.defaults.properties file...
    Code:
    Document was loaded from Application Cache with manifest http://localhost:1843/cache.appcache
    (index):1 Application Cache Checking event
    (index):1 Application Cache NoUpdate event
    XHR finished loading: GET "http://localhost:1843/app.js?1416934131729".
    XHR finished loading: GET "http://localhost:1843/app.json?1416934132123".
    VM740:1 Uncaught TypeError: Cannot read property 'log' of undefined  VM740:1 (anonymous function)
    There are some coding Considerations here as well. I am using Ext.Logger.log extensivily in the application, beginning with these external classes. I am commenting them out and will again edit this post with my results...

  2. #2
    Sencha User
    Join Date
    Jan 2009
    Location
    Frederick, Maryland
    Posts
    925
    Answers
    66

    Default

    That was going to be my guess. That some type of log or debugger is tripping up the production build.

  3. #3
    Sencha Premium Member
    Join Date
    Jul 2014
    Location
    Bakersfield CA
    Posts
    81
    Answers
    3

    Default

    This is what I had to do to get this to work, and I still am not sure exactly what made it begin compliling properly.
    1. Use Architect to go through all the code and replace Ext.Logger with //Ext.Logger in order to comment out all my debugging code - I thought this was handled by the compiler, but obviously, it just has to screw up for this project.
    2. Experience the blowup on the code in .sencha/app/microloader/production.js where this code snippet...
    Code:
        function log(message) {
    if (typeof console != 'undefined') {
                (console.error || console.log).call(console, message);
            }
        }
    will keep the app from loading.

    This is where you might stay for many hours, because when this section screws up, the minimized code produced in the index.html file is all you have to work with. It will look like this...
    Screen Shot 2014-12-02 at 7.37.32 AM.png
    and it will show as an error about a missing token.

    Then you might begin to update your Touch libraries, set your CMD to the latest version. You might do what I did and Beautify the code, then paste it back into the index file and run successfully in debug mode.

    It's likely you will see that the code run without an issue after you do this, as I did.
    It made me feel better at least!

    You might read every log entry that occurs, and you will learn about what the build process is doing. This will not help you unless you are actually experiencing build errors, but do it anyway.

    You will struggle to understand why your beautified code still persists in the browser cache after you have re-run the production build and replaced the index.html multiple times. You may do like I did and restart the Jetty Server to prevent it from caching.

    After all this (over a day) you may just sit down to your workstation with a sign of resignation, and suddenly the production build begins working. What an anti-climax...

    Do I have a significant new way to get your build working? No, but I thought I would share what I had to go through to get a production build to work. Also that my new development process includes testing a Production Build at least 2-3 times during the day to make sure it's still working.

    I really like Sencha the more I use it, but without as deep an understanding as I had of ActionScript and FLEX Classes, this development process is slow and mind numbing in it's hidden gotchas.

    Maybe one day I'll be able to help someone about this topic with greater knowledge. Right now though, I can only write what I am experiencing.

Posting Permissions

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