I am running an Express app, and I am getting a JS_Parse_Error. I cannot figure out why. I have basically commented out all of the new code that I've written, yet I am still getting the error. Is there a way to find out what Javascript line is giving me the error?
Error
at new JS_Parse_Error (/home/charlie/Projects/chat/node_modules/jade/node_modules/with/node_modules/uglify-js/lib/parse.js:196:18)
at js_error (/home/charlie/Projects/chat/node_modules/jade/node_modules/with/node_modules/uglify-js/lib/parse.js:204:11)
at croak (/home/charlie/Projects/chat/node_modules/jade/node_modules/with/node_modules/uglify-js/lib/parse.js:636:9)
at token_error (/home/charlie/Projects/chat/node_modules/jade/node_modules/with/node_modules/uglify-js/lib/parse.js:644:9)
at expect_token (/home/charlie/Projects/chat/node_modules/jade/node_modules/with/node_modules/uglify-js/lib/parse.js:657:9)
at expect (/home/charlie/Projects/chat/node_modules/jade/node_modules/with/node_modules/uglify-js/lib/parse.js:660:36)
at expr_atom (/home/charlie/Projects/chat/node_modules/jade/node_modules/with/node_modules/uglify-js/lib/parse.js:1112:17)
at maybe_unary (/home/charlie/Projects/chat/node_modules/jade/node_modules/with/node_modules/uglify-js/lib/parse.js:1287:19)
at expr_ops (/home/charlie/Projects/chat/node_modules/jade/node_modules/with/node_modules/uglify-js/lib/parse.js:1322:24)
at maybe_conditional (/home/charlie/Projects/chat/node_modules/jade/node_modules/with/node_modules/uglify-js/lib/parse.js:1327:20)
This might not be relevant for you anymore, but I got this same error message - Which is not so verbose I have to say - And my problem was a comma missing.
Notice the comma missing before ng-show...
.container(itemscope, itemtype='http://schema.org/Person' ng-show='user')
.row
I had the same problem with an array of key/value pairs.
My code looked like this:
- var links = {stack-overflow: "//stackoverflow.com/users/2479481/"}
Apparently, you can't use hyphens in your keys without wrapping the key in quotes.
So, to fix the problem, you can do either
- var links = {"stack-overflow": "//stackoverflow.com/users/2479481/"}
or
- var links = {stackoverflow: "//stackoverflow.com/users/2479481/"}
Another thing that might be a problem (what was the problem in my case) are regular expressions. Make sure you create regex like this new RegExp("/[^ ]+/g") instead of /[^ ]+/g
Also use var instead of let.
Hope this helps someone,
uglify-js version 1.2.6
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With