0

Warning: Uglification failed. Unexpected token: punc ()).

grunt build gives this issue, which calls the uglify task, does it have to do with the ':' that I've misused?

user2167582
  • 5,986
  • 13
  • 64
  • 121
  • how do you expect us to help you if you're not going to show us the code? – Stephen Thomas Mar 11 '14 at 22:51
  • I resolved it differently from the solutions provided. – user2167582 Mar 12 '14 at 00:12
  • @user2167582 Well thank you very much for providing the solution for all of the others in this world that may have also run into this issue. Thank you so much for your value-added, selfless contribution to the community... – Swivel Oct 23 '15 at 07:33
  • @Swivel hey smartass, what's in it for you to throw random comments on trivial issues tickets? – user2167582 Oct 24 '15 at 11:43
  • @user2167582 Stack Exchange, incl. Stackoverflow, is a community meant not just for asking questions and providing answers, but to provide the world surrounding each sites' focus areas a location to seek the answers to problems they face. By asking a question on this site, figuring out the solution, and failing to answer your own question, you're depriving every single visitor to this question the resolution you spent time to figure out. This is a KB; a community. If even once you have figured out a solution to an issue using SO, the least you could do to repay the community is to contribute. – Swivel Oct 26 '15 at 16:34
  • @user2167582 I'm not here to have an argument; I'm here to make a point. Far from a random comment when you find a solution to your problem and then leave a useless comment like "I resolved it different from the solutions provided." How does that help anyone? (rhetorical question, don't answer that). All I'm trying to say is be mindful that people don't just use this site to ask questions, but also to seek the answers that others have received. It's OK to answer your own question. – Swivel Oct 26 '15 at 16:38
  • @Swivel didn't know there was a close function, or else woulda closed it – user2167582 Jul 15 '16 at 02:23

1 Answers1

3

There is a stray comma at the end of "in_orderId": $rootScope.payBillResponse.CheckoutResponse.OrderId, and there is a colon that could be put on a single line as part of !(engine.propertyIsEnumerable('length'))) ? engine[0] : engine;.

If neither of those help, make a copy of the file and remove first the top half and run uglify, and see if you get the error, then repeat with the bottom half, repeat to isolate the cause.

The benefits of using a tool like http://www.jslint.com/ or http://jshint.com/ or http://eslint.org/ include helping to keep your code cleaner and closer to standard so that it is less likely to throw errors with tools like uglify.

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
  • thanks for your advice, the issue resolved looks like a console.log() no semi colon issue, no idea why, but yes without this block uglify is successful – user2167582 Mar 12 '14 at 00:10