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

Replace uglifier with terser #2234

Merged
merged 1 commit into from
May 9, 2023
Merged

Conversation

julianguyen
Copy link
Member

@julianguyen julianguyen commented May 9, 2023

Description

As recommended in this react/react-rails issue, switching from uglifier to terser to address the following error:

remote:        I, [2023-05-09T16:35:58.877827 #2725]  INFO -- sentry: ** [Sentry] [Transport] Sending envelope with items [event] d786d36a0e114eecbf7e33f5862d8f0e to Sentry        
remote:        Uglifier::Error: Unexpected token: keyword (const). To use ES6 syntax, harmony mode must be enabled with Uglifier.new(:harmony => true).        
remote:        /tmp/build_bf919405/vendor/bundle/ruby/3.1.0/gems/uglifier-4.1.20/lib/uglifier.rb:234:in `parse_result'        
remote:        /tmp/build_bf919405/vendor/bundle/ruby/3.1.0/gems/uglifier-4.1.20/lib/uglifier.rb:216:in `run_uglifyjs'        
remote:        /tmp/build_bf919405/vendor/bundle/ruby/3.1.0/gems/uglifier-4.1.20/lib/uglifier.rb:168:in `compile'        
remote:        /tmp/build_bf919405/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/uglifier_compressor.rb:53:in `call'        
remote:        /tmp/build_bf919405/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/uglifier_compressor.rb:28:in `call'        
remote:        /tmp/build_bf919405/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:75:in `call_processor'        
remote:        /tmp/build_bf919405/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:57:in `block in call_processors'        
remote:        /tmp/build_bf919405/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:56:in `reverse_each'        
remote:        /tmp/build_bf919405/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:56:in `call_processors'        
remote:        /tmp/build_bf919405/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:134:in `load_from_unloaded'        
remote:        /tmp/build_bf919405/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:60:in `block in load'        
remote:        /tmp/build_bf919405/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'        
remote:        /tmp/build_bf919405/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:44:in `load'        
remote:        /tmp/build_bf919405/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:20:in `block in initialize'        
remote:        /tmp/build_bf919405/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:47:in `load'        
remote:        /tmp/build_bf919405/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/base.rb:66:in `find_asset'        
remote:        /tmp/build_bf919405/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/base.rb:73:in `find_all_linked_assets'        
remote:        /tmp/build_bf919405/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:134:in `block in find'        
remote:        /tmp/build_bf919405/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:133:in `each'        
remote:        /tmp/build_bf919405/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:133:in `find'        
remote:        /tmp/build_bf919405/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:186:in `compile'        
remote:        /tmp/build_bf919405/vendor/bundle/ruby/3.1.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/task.rb:67:in `block (3 levels) in define'        
remote:        /tmp/build_bf919405/vendor/bundle/ruby/3.1.0/gems/sprockets-3.7.2/lib/rake/sprocketstask.rb:147:in `with_logger'        
remote:        /tmp/build_bf919405/vendor/bundle/ruby/3.1.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/task.rb:66:in `block (2 levels) in define'        
remote:        /tmp/build_bf919405/vendor/bundle/ruby/3.1.0/gems/sentry-ruby-5.9.0/lib/sentry/rake.rb:26:in `execute'

Reviewing this pull request? Check out our Code Review Practices guide if you haven't already!

@julianguyen julianguyen merged commit f4a8866 into main May 9, 2023
@delete-merged-branch delete-merged-branch bot deleted the replace-terser-with-uglifier branch May 9, 2023 19:20
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

Successfully merging this pull request may close these issues.

None yet

1 participant