Results 1 to 2 of 2

Thread: when doing production build, get error: SyntaxError: Invalid regular expression

  1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    72

    Default when doing production build, get error: SyntaxError: Invalid regular expression

    Hi all,

    I'm having a problem getting a production build to load in the browser. I am using Architect, and doing the production build that way (which I'm assuming is pretty much the same as if I did cmd through the command line).

    I can do a build for testing and that actually works fine, but when I switch to production, I get an error in app.js that is:

    Error evaluating app.js with message: SyntaxError: Invalid regular expression: nothing to repeat

    (that's what Safari is reporting)

    The big difference that I see between production and testing is that all of the js files get minified, so I'm guessing there is something with the minification causing this problem. That makes it pretty tough to debug, because I can't really figure out where the error is coming from in the minified app.js file.

    I know this isn't much to go on, but I'm wondering if anyone else has come across something like this in cmd, and if there is a compile option or something to set to overcome it.


    Thanks!

  2. #2
    Sencha User
    Join Date
    Dec 2011
    Posts
    72

    Default

    By the way, I got this to work by building the application, still using 'Test' instead of 'Production', but afterward I compressed the app.js file using UglifyJs (instead of the YUI compressor that cmd uses). UglifyJs did a good job ( from 2.5 MB down to 650 KB ), and my app worked after that. I did not get the message I indicated above. So, maybe there is some flag or something in the YUI compressor that would be helpful to be able to set? Not sure. Anyway, this does highlight the fact that all js compressors are not the same. Hope this helps anyone else out there having similar problems.
    Last edited by scheid; 10 Aug 2014 at 8:28 AM. Reason: correct typo

Posting Permissions

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