1. #1
    Sencha User
    Join Date
    Oct 2012
    Location
    San Francisco
    Posts
    13
    Answers
    1
    Vote Rating
    0
    antun is on a distinguished road

      0  

    Default Unanswered: Syntax error in production build, no error in testing build

    Unanswered: Syntax error in production build, no error in testing build


    I just made a small change to my app (added a new Panel) and when I do a production build, the app throws a syntax error in the browser console:

    Code:
    Error evaluating http://localhost/~antun/spanishflashcards/build/production/app.js with message: SyntaxError: Unexpected identifier /~antun/spanishflashcards/build/production/:57
    Here's what line 57 of index.html looks like:

    Code:
    a){e.callback(b);k.body.removeChild(f);m.splice(c,1);break}}function G(a){"undefined"!=typeof console&&(console.error||console.log).call(console,a)}function s(a,b){try{n.setItem(a,b)}catch(c){if(c.code==c.QUOTA_EXCEEDED_ERR){var d=t.assets.map(function(a){return a.key}),e=0,f=n.length,l=!1,j;for(d.push(t.key);e<=f-1;)j=n.key(e),-1==d.indexOf(j)?(n.removeItem(j),l=!0,f--):e++;l&&s(a,b)}}}function u(a){try{return n.getItem(a)}catch(d){return null}}function M(){H||(H=!0,p(o,function(a){(new r(a)).store();
    Not sure where to start with this? The app starts fine if I do sencha app build testing. Also, it's worth mentioning that the index.html file in build/production/ is *not*s just a minified version of build/testing/index.html. There's a lot more code in build/production/index.html, and line 57 falls into that new code.

    Thanks,

    Antun

  2. #2
    Sencha User
    Join Date
    Oct 2012
    Location
    San Francisco
    Posts
    13
    Answers
    1
    Vote Rating
    0
    antun is on a distinguished road

      0  

    Default


    I've been doing some debugging, and this appears to be an application cacheing issue. I'm new to the HTML5 app cacheing functionality, and Sencha Touch enables this by default for the production build.

    It's actually quite hard to clear the cache (and there appear to be some bugs in Chrome where it sometimes won't clear until you restart the browser). So rather than risk deploying my app, I removed application caching altogether (by erasing the manifest="" attribute in the <html> tag in index.html). Also, I had to clear out the build directory, since the sencha app build production command leaves any cache.manifest files in the build/production directory.

    Not sure if I disabled the cache correctly or not. I have to research it a little more.

  3. #3
    Sencha User
    Join Date
    Mar 2011
    Location
    Shanghai
    Posts
    71
    Answers
    1
    Vote Rating
    0
    perry_jia is on a distinguished road

      0  

    Default


    I also met this problem, and it does the HTML5 cache caused, when clear the chrome cache, build production nice. Did you have sovle the problem?
    Waiting...

  4. #4
    Sencha User
    Join Date
    Oct 2012
    Location
    San Francisco
    Posts
    13
    Answers
    1
    Vote Rating
    0
    antun is on a distinguished road

      0  

    Default


    Yes, the steps I described in my last post solved the problem: I removed application cacheing altogether, cleared the Chrome cache, and deleted the build/production directory and rebuilt.

Thread Participants: 1