Uglifier::Error: Unexpected token: punc ((). To use ES6 syntax, harmony mode must be enabled with Uglifier.new(:harmony => true)
See original GitHub issueHi,
When I run “rake assets:precompile RAILS_ENV=production” command, I have issue.
rake assets:precompile RAILS_ENV=production
rake aborted!
Uglifier::Error: Unexpected token: punc ((). To use ES6 syntax, harmony mode must be enabled with Uglifier.new(:harmony => true).
/Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/uglifier-4.0.2/lib/uglifier.rb:237:in parse_result' /Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/uglifier-4.0.2/lib/uglifier.rb:219:in
run_uglifyjs’
/Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/uglifier-4.0.2/lib/uglifier.rb:169:in compile' /Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/uglifier_compressor.rb:53:in
call’
/Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/uglifier_compressor.rb:28:in call' /Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:75:in
call_processor’
/Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:57:in block in call_processors' /Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in
reverse_each’
/Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in call_processors' /Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/loader.rb:134:in
load_from_unloaded’
/Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/loader.rb:60:in block in load' /Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/loader.rb:317:in
fetch_asset_from_dependency_cache’
/Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/loader.rb:44:in load' /Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:20:in
block in initialize’
/Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:47:in load' /Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/base.rb:66:in
find_asset’
/Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/base.rb:73:in find_all_linked_assets' /Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:142:in
block in find’
/Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:114:in block (2 levels) in logical_paths' /Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:228:in
block in stat_tree’
/Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:212:in block in stat_directory' /Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:209:in
each’
/Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:209:in stat_directory' /Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:227:in
stat_tree’
/Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:105:in each' /Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:105:in
block in logical_paths’
/Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:104:in each' /Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:104:in
logical_paths’
/Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:140:in find' /Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:185:in
compile’
/Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:68:in block (3 levels) in define' /Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-3.7.1/lib/rake/sprocketstask.rb:147:in
with_logger’
/Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:67:in block (2 levels) in define' /Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/gems/rake-12.2.1/exe/rake:27:in
<top (required)>’
/Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/bin/ruby_executable_hooks:15:in eval' /Users/leonverspeek/.rvm/gems/ruby-2.3.1@zombie/bin/ruby_executable_hooks:15:in
<main>’
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
How to fix this issue?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:41
- Comments:31 (1 by maintainers)
Top GitHub Comments
Try replacing
with
in
config/environments/production.rb
abraham, you save my day