Hybrid View

  1. #1
    Sencha User
    Join Date
    Mar 2010
    Posts
    435
    Answers
    10
    Vote Rating
    -1
    abcdef is an unknown quantity at this point

      0  

    Default Unanswered: Cache manifest error in production

    Unanswered: Cache manifest error in production


    Hello, I'm trying to deploy my app to production and I pointed the index.html to build/production/app/index.hml. When I try to run it on production, I get the following error"

    Code:
    Creating Application Cache with manifest http://localhost:4000/cache.appcache(index):1
    Application Cache Checking event (index):1
    
    • [COLOR=red !important]Uncaught SyntaxError: Unexpected token / (index):174
    [/COLOR] Application Cache Error event: Manifest fetch failed (404) http://localhost:4000/cache.appcache
    My index.html @ 174 looks like:

    Code:
    manifest = jsonParse(manifestContent);
    manifestContent looks like:

    Code:
    {    /**     * The application's namespace, used by Sencha Command to generate classes     */    "name": "sdf",    /**     * The file path to this application's front HTML document, relative to this app.json file     */    "indexHtmlPath": "index.html",    /**     * The absolute URL to this application in development environment, i.e: the URL to run this application     * on your web browser during development, e.g: "http://localhost/myapp/index.html".     *     * This value is needed when build to resolve your application's dependencies if it requires server-side resources     * that are not accessible via file system protocol.     */    "url": null,    /**     * List of all JavaScript assets in the right execution order.     * Each item is an object with the following format:     *      {     *          "path": "path/to/script.js" // Path to file, if local file it must be relative to this app.json file     *          "remote": true              // (Optional)     *                                      // - Defaults to undefined (falsey) to signal a local file which will be copied     *                                      // - Specify true if this file is a remote file which will not to be copied     *          "update": "delta"           // (Optional)     *                                      //  - If not specified, this file will only be loaded once, and     *                                      //    cached inside localStorage until this value is changed.     *                                      //  - "delta" to enable over-the-air delta update for this file     *                                      //  - "full" means full update will be made when this file changes     *          "x-bootstrap": true         // (Optional)     *                                      // Indicates a development mode only dependency.       *                                      // These files will not be copied into the build directory or referenced     *                                      // in the generate app.json manifest for the micro loader.     *     *      }     */    "js": [		{			"path": "phonegap.js",			"remote": true		},        {            "path": "touch/sencha-touch.js",            "x-bootstrap": true        },        {            "path": "bootstrap.js",            "x-bootstrap": true        },        {            "path": "app.js",            "bundle": true,  /* Indicates that all class dependencies are concatenated into this file when build */            "update": "full"        }    ],    /**     * List of all CSS assets in the right inclusion order.     * Each item is an object with the following format:     *      {     *          "path": "path/to/item.css" // Path to file, if local file it must be relative to this app.json file     *          "remote": true             // (Optional)     *                                     // - Defaults to undefined (falsey) to signal a local file which will be copied     *                                     // - Specify true if this file is a remote file which will not to be copied     *          "update": "delta"          // (Optional)     *                                     //  - If not specified, this file will only be loaded once, and     *                                     //    cached inside localStorage until this value is changed to either one below     *                                     //  - "delta" to enable over-the-air delta update for this file     *                                     //  - "full" means full update will be made when this file changes     *     *      }     */    "css": [        /*{            "path": "resources/css/cupertino.css",            "theme": "Cupertino",            "update": "delta"        },*/        {            "path": "resources/css/app.css",            "theme": "X",            "update": "full"        }    ],    /**     * Used to automatically generate cache.manifest (HTML 5 application cache manifest) file when you build     */    "appCache": {        /**         * List of items in the CACHE MANIFEST section         */        "cache": [            "index.html"        ],        /**         * List of items in the NETWORK section         */        "network": [            "*"        ],        /**         * List of items in the FALLBACK section         */        "fallback": []    },    /**     * Extra resources to be copied along when build     */    "resources": [		"config.xml",        "resources/images",        "resources/icons",        "resources/startup"    ],    /**     * File / directory name matchers to ignore when copying to the builds, must be valid regular expressions     */    "ignore": [        "\.svn$"    ],    /**     * Directory path to store all previous production builds. Note that the content generated inside this directory     * must be kept intact for proper generation of deltas between updates     */    "archivePath": "archive",    /**     * List of package names to require for the cmd build process     */    "requires": [    ],    /**     * Uniquely generated id for this application, used as prefix for localStorage keys.     * Normally you should never change this value.     */    "id": "24h9sje45-a94c-4fa0-bc33-fcs863b01d28"}
    I changed some of my 'delta's to 'full' to verify, but neither works.

    Thoughts?

    Any help is much appreciated! Thanks!

  2. #2
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    3,716
    Answers
    314
    Vote Rating
    116
    fmoseley is a glorious beacon of light fmoseley is a glorious beacon of light fmoseley is a glorious beacon of light fmoseley is a glorious beacon of light fmoseley is a glorious beacon of light fmoseley is a glorious beacon of light

      0  

    Default


    It looks like there is a problem parsing your app.json.
    The comments should have been removed when you ran sencha app build.
    Check your app.json and make sure that the json is valid.
    Get more personalized support via a support subscription.

    Want to learn Sencha Touch 2? Check out
    Sencha training
    Sencha Touch in Action

    Need more help with your app? Hire Sencha Services services@sencha.com

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

  3. #3
    Sencha User
    Join Date
    Mar 2010
    Posts
    435
    Answers
    10
    Vote Rating
    -1
    abcdef is an unknown quantity at this point

      0  

    Default


    Quote Originally Posted by fmoseley View Post
    It looks like there is a problem parsing your app.json.
    The comments should have been removed when you ran sencha app build.
    Check your app.json and make sure that the json is valid.
    JSON Lint says that the file is valid. Any other thoughts? Thanks for the help!

  4. #4
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    3,716
    Answers
    314
    Vote Rating
    116
    fmoseley is a glorious beacon of light fmoseley is a glorious beacon of light fmoseley is a glorious beacon of light fmoseley is a glorious beacon of light fmoseley is a glorious beacon of light fmoseley is a glorious beacon of light

      0  

    Default


    Check your build/production/YourAppName/app.json. What does it look like? Are there comments in there? Please attach the file with your app.json?
    Get more personalized support via a support subscription.

    Want to learn Sencha Touch 2? Check out
    Sencha training
    Sencha Touch in Action

    Need more help with your app? Hire Sencha Services services@sencha.com

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

  5. #5
    Sencha User
    Join Date
    Mar 2010
    Posts
    435
    Answers
    10
    Vote Rating
    -1
    abcdef is an unknown quantity at this point

      0  

    Default


    Quote Originally Posted by fmoseley View Post
    Check your build/production/YourAppName/app.json. What does it look like? Are there comments in there? Please attach the file with your app.json?
    Yes, that is the one I was talking about:

    Code:
    {   
       "id":"2f9bfa45-a94c-4fa0-bc33-fc73179e1d28",
       "js":[
          {
             "path":"phonegap.js",
             "remote":true
          },
          {
             "path":"app.js",
             "update":"full",
             "version":"da39a3ee5e6b4b0d3255bfef95601890afd80709"
          }
       ],
       "css":[
          {
             "path":"resources/css/app.css",
             "update":"full",
             "theme":"Blah",
             "version":"5d557d29f4205de76dd81389af15fa10f622fc4a"
          }
       ]
    }
    I just beautified it – it was originally minified.

  6. #6
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    3,716
    Answers
    314
    Vote Rating
    116
    fmoseley is a glorious beacon of light fmoseley is a glorious beacon of light fmoseley is a glorious beacon of light fmoseley is a glorious beacon of light fmoseley is a glorious beacon of light fmoseley is a glorious beacon of light

      0  

    Default


    Try clearing your application cache and local storage and browsing to your production build index.html again.
    Get more personalized support via a support subscription.

    Want to learn Sencha Touch 2? Check out
    Sencha training
    Sencha Touch in Action

    Need more help with your app? Hire Sencha Services services@sencha.com

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

  7. #7
    Sencha User
    Join Date
    Mar 2010
    Posts
    435
    Answers
    10
    Vote Rating
    -1
    abcdef is an unknown quantity at this point

      0  

    Default


    Quote Originally Posted by fmoseley View Post
    Try clearing your application cache and local storage and browsing to your production build index.html again.
    That didn't work either. I tried removing everything with Chrome using chrome://appcache-internals/ and Chrome extension: HTML5 LocalStorage Manager.

    Here are some observations:

    1. My dev is working fine – it downloads all the JS files
    separately etc.

    2. I'm using Node with GeddyJS, and here is the code snippet in Node that serves the right file:

    Code:
        me.index = function(req, resp, params) {
            var self = this, fs = require('fs');
            if (geddy.config.environment == 'production') {
                fs.readFile('./public/build/production/appname/index.html', function(err, data) {
                    if (err) {
                        throw err;
                    }
                    self.output(200, {
                        'Content-Type': 'text/html'
                    }, data.toString());
                });
            }
            else {
                fs.readFile('./public/index.html', function(err, data) {
                    if (err) {
                        throw err;
                    }
                    self.output(200, {
                        'Content-Type': 'text/html'
                    }, data.toString());
                });
            }
        };

    3. I have confirmed the correct file loads

    4. When I start Node in production environment, which I do by running geddy -e production, the correct file gets served, but that gives the same exact error I mentioned before.

    5. But, when I start Node in development environment, which I do by running just geddy, and then if I navigate to <localhost:4000>/
    build/production/appname/index.html, it doesn't throw any errors, but doesn't load the application either – it gets stuck at the loading screen animation, which it is picking from whats in index.html. The console says:

    Creating Application Cache with manifest http://localhost:4000/build/production/appname/cache.appcache index.html:1
    Application Cache Checking event index.html:1
    Application Cache Downloading event index.html:1
    Application Cache Progress event (0 of 1) http://localhost:4000/build/production/appname/index.html index.html:1
    Application Cache Progress event (1 of 1) index.html:1
    Application Cache Cached event


    5. I'm using Phonegap as well, and when I run sencha app build native with phone gap remote build, and when I download and install to my iPhone the ipa file from Phonegap Build, it is stuck at the loading screen as well.

    All the builds are being completed successfully.

    I'm stuck right now, and I'd really appreciate any help you can provide me. Thank you again for your time.

  8. #8
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    3,716
    Answers
    314
    Vote Rating
    116
    fmoseley is a glorious beacon of light fmoseley is a glorious beacon of light fmoseley is a glorious beacon of light fmoseley is a glorious beacon of light fmoseley is a glorious beacon of light fmoseley is a glorious beacon of light

      0  

    Default


    There is currently a issue with production builds. Sounds like it could be causing the issue you are experiencing. An update to Cmd should be released in the next week or so.
    Get more personalized support via a support subscription.

    Want to learn Sencha Touch 2? Check out
    Sencha training
    Sencha Touch in Action

    Need more help with your app? Hire Sencha Services services@sencha.com

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

  9. #9
    Sencha User
    Join Date
    Mar 2010
    Posts
    435
    Answers
    10
    Vote Rating
    -1
    abcdef is an unknown quantity at this point

      0  

    Default


    Quote Originally Posted by fmoseley View Post
    There is currently a issue with production builds. Sounds like it could be causing the issue you are experiencing. An update to Cmd should be released in the next week or so.
    Okay, I'll check back later then. Thanks for your time again!

  10. #10
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    3,716
    Answers
    314
    Vote Rating
    116
    fmoseley is a glorious beacon of light fmoseley is a glorious beacon of light fmoseley is a glorious beacon of light fmoseley is a glorious beacon of light fmoseley is a glorious beacon of light fmoseley is a glorious beacon of light

      0  

    Default


    No problem. Looks like this will not be released until after the holidays.
    Get more personalized support via a support subscription.

    Want to learn Sencha Touch 2? Check out
    Sencha training
    Sencha Touch in Action

    Need more help with your app? Hire Sencha Services services@sencha.com

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

Thread Participants: 1