Closed serebit closed 5 years ago
Hi!
This issue generally only occurs due to a parsing failure in the javascript.
The error message is showing you is that there is a syntax error in your javascript on line 37 which it is unable to parse and recover from, therefore throwing an error.
I recommend analysing your javascript to ascertain where the syntax error is occuring and correcting that.
The easiest way to do this is to use dev tools on your browser.
Hope that helps
Matt
If I'm correct, the error is caused by this line:
response.forEach(data => addDownload(data));
This is valid ES6 syntax.
Hi there,
Yeah, you're correct, however it appears that the library I'm using for minification of JS does not support ES6 as yet.
https://rubygems.org/gems/uglifier - https://github.com/lautis/uglifier
It is being actively developed, so it may be best to contact them to see if they're able to add support.
Matt
I second to this, adding the following lightly different error. I hope it helps debugging
jekyll 3.7.2 | Error: SyntaxError: Unexpected token: operator (<)
I'm having the same bug. The JS minifier neither recognises properly the let
token on cases like this: let a = 3
.
I have the same issue. I can't use arrow function or let
keyword
Confirm that issue.
My code has:
let n = Math.abs(number);
Also, seems like uglifier is updated to 4.1.18 (you demand ~> 3.2)
And one more thing: When using Uglifier with ES6 syntax without any options, an error will be thrown. (source: https://github.com/lautis/uglifier) So, maybe it could be better to provide some config option or encourage users to use ES6...
ES6 is now supported by upstream, I've opened up the settings to be able to change harmony on uglifier etc.
jekyll 3.8.5 | Error:
Whan i try bundle exec jekyll build JEKYLL_ENV="production" --watch --incremental
@kroschu
try this:
JEKYLL_ENV="production" bundle exec jekyll build --watch --incremental
Environment variables go at the beginning, before the command. you can also set them in your terminal and just run your commands as normal.
Matt
Here's the stack trace:
If I disable parsing JS using _config.yml, the error does not occur.