digitalsparky / jekyll-minifier

Jekyll HTML/XML/CSS/JS Minifier utilising yui-compressor, and htmlcompressor
GNU General Public License v3.0
245 stars 25 forks source link

Unexpected token errors #22

Open malford89 opened 7 years ago

malford89 commented 7 years ago

Hello I am making a website using Jekyll and Foundation 6. After install I got an error that I am unable to make sense of. Can you explain to me what is happening in the console after I did jekyll serve. Here is my error: `jekyll 3.4.2 | Error: Unexpected token: name (Abide) (line: 10, col: 6, pos: 91)

Error at new JS_Parse_Error (/private/var/folders/x1/qjqh58fs0kjdspmhldlvvzf80000gn/T/execjs20170417-27073-x7pzazjs:2659:11936) at js_error (/private/var/folders/x1/qjqh58fs0kjdspmhldlvvzf80000gn/T/execjs20170417-27073-x7pzazjs:2659:12155) at croak (/private/var/folders/x1/qjqh58fs0kjdspmhldlvvzf80000gn/T/execjs20170417-27073-x7pzazjs:2659:20622) at token_error (/private/var/folders/x1/qjqh58fs0kjdspmhldlvvzf80000gn/T/execjs20170417-27073-x7pzazjs:2659:20759) at unexpected (/private/var/folders/x1/qjqh58fs0kjdspmhldlvvzf80000gn/T/execjs20170417-27073-x7pzazjs:2659:20847) at semicolon (/private/var/folders/x1/qjqh58fs0kjdspmhldlvvzf80000gn/T/execjs20170417-27073-x7pzazjs:2659:21320) at simplestatement (/private/var/folders/x1/qjqh58fs0kjdspmhldlvvzf80000gn/T/execjs20170417-27073-x7pzazjs:2659:24179) at /private/var/folders/x1/qjqh58fs0kjdspmhldlvvzf80000gn/T/execjs20170417-27073-x7pzazjs:2659:22152 at /private/var/folders/x1/qjqh58fs0kjdspmhldlvvzf80000gn/T/execjs20170417-27073-x7pzazjs:2659:21493 at block (/private/var/folders/x1/qjqh58fs0kjdspmhldlvvzf80000gn/T/execjs20170417-27073-x7pzazjs:2659:26198)`

ellisonch commented 7 years ago

I'm having the same problem. I got:

jekyll 3.4.3 | Error:  Unexpected token: punc ()) (line: 152, col: 1, pos: 3508)

I was able to laboriously guess and check which file it came from, but it would be super helpful if you added the filename to the output.

digitalsparky commented 7 years ago

Thanks for your reports, I'll look into these errors and try to get them resolved.

johnchourajr commented 6 years ago

@malford89 @ellisonch @digitalsparky

I got this error when I used let vs. var for my variables. The minified didn't like let so I changed everything back to var and it fixed my issue.

rbuchberger commented 5 years ago

I'm also receiving this issue, as well as problems with arrow functions and back-quote string interpolation. Seems the minifier doesn't like ES6 syntax.

z3nth10n commented 5 years ago

I'm having this issue too... 😭