Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uglifier::Error: Unexpected token: keyword (const) #9

Open
parterburn opened this issue Jun 19, 2018 · 2 comments
Open

Uglifier::Error: Unexpected token: keyword (const) #9

parterburn opened this issue Jun 19, 2018 · 2 comments

Comments

@parterburn
Copy link

When deploying on Heroku, there's a new error that popped up after upgrading to the latest Sprockets, per the vulnerability described at https://blog.heroku.com/rails-asset-pipeline-vulnerability

Uglifier::Error: Unexpected token: keyword (const). To use ES6 syntax, harmony mode must be enabled with Uglifier.new(:harmony => true).

Gem versions:

sprockets (3.7.2)
sprockets_uglifier_with_source_maps (2.1.0)
uglifier (4.1.11)
sprockets-rails (3.2.1)
@parterburn parterburn changed the title Uglifier::Error: Unexpected token: keyword (const Uglifier::Error: Unexpected token: keyword (const) Jun 19, 2018
@parterburn
Copy link
Author

I got around this by adding config.assets.uglifier = { harmony: true } above config.assets.js_compressor = :uglifier_with_source_maps in production.rb.

breadoliveoilsalt added a commit to breadoliveoilsalt/garden-tracker that referenced this issue Nov 15, 2018
…harmony: true }

Doing this due to error popping up on testing heroku deployment.
See here: AlexanderPavlenko/sprockets_uglifier_with_source_maps#9
@Halt
Copy link

Halt commented Jun 5, 2019

in production.rb change to:
config.assets.js_compressor = Uglifier.new(harmony: true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants