I am facing this problem
Uglifier::Error: Unexpected token: keyword (const). To use ES6 syntax, harmony mode must be enabled with Uglifier.new(:harmony => true).
while deploying the project through capistrano on production.
I followed this solution
https://github.com/lautis/uglifier/issues/127#issuecomment-352224986
which suggests
replacing
config.assets.js_compressor = :uglifier
with
config.assets.js_compressor = Uglifier.new(harmony: true)
but even after doing that I am still facing the same error. I dont understand what went wrong. I am using uglifier (4.1.20)
version
Just leaving the answer here too:
In config/environments/production.rb
replace
config.assets.js_compressor = :uglifier
with
config.assets.js_compressor = Uglifier.new(harmony: true)