rails / webpacker

Use Webpack to manage app-like JavaScript modules in Rails

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Code in yarn:install breaks prerequisites

tbolender opened this issue · comments

Hi there!

We recently upgraded to webpacker 6 and now receive an exception during assets:precompile in our CI:

#14 219.8 ArgumentError: wrong exec option symbol: exception
#14 219.8 /app/vendor/bundle/ruby/2.5.0/gems/webpacker-6.0.0.rc.5/lib/tasks/yarn.rake:21:in 'system'
#14 219.8 /app/vendor/bundle/ruby/2.5.0/gems/webpacker-6.0.0.rc.5/lib/tasks/yarn.rake:21:in 'block (2 levels) in <top (required)>'
#14 219.8 /app/vendor/bundle/ruby/2.5.0/gems/sentry-ruby-core-4.6.5/lib/sentry/rake.rb:23:in 'block in execute'
#14 219.8 /app/vendor/bundle/ruby/2.5.0/gems/sentry-ruby-core-4.6.5/lib/sentry/hub.rb:153:in 'with_background_worker_disabled'
#14 219.8 /app/vendor/bundle/ruby/2.5.0/gems/sentry-ruby-core-4.6.5/lib/sentry/rake.rb:22:in 'execute'
#14 219.8 /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.5/lib/rails/commands/rake/rake_command.rb:23:in 'block in perform'
#14 219.8 /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.5/lib/rails/commands/rake/rake_command.rb:20:in 'perform'
#14 219.8 /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.5/lib/rails/command.rb:48:in 'invoke'
#14 219.8 /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.5/lib/rails/commands.rb:18:in '<top (required)>'
#14 219.8 bin/rails:9:in 'require'
#14 219.8 bin/rails:9:in '<main>'

We are currently still on Ruby 2.5.9. I noticed that the exception parameter is not present in 2.5.9, but in 2.7.x and later. I think it is totally legit to drop support, however updating the documentation would be great to avoid confusion (if intended).

P.S.: I am surprised by the existence of this task anyway and currently try to disable it, but that's a different story...

Did you upgrade your node packages too?

I followed the upgrading instructions. Nevertheless, the node packages should make no difference since the exception parameter which causes the issue is in the Ruby universe. Since we needed webpacker 6 we now upgraded to Ruby 2.7 (was anyway on the roadmap), so our setup works now.

As said I think it is reasonable to drop support for EOL Ruby version, I just recommend to update the documentation accordingly.

UPDATE:

It starts working from ruby 2.6 in their new features (look for Kernel#system in https://www.ruby-lang.org/en/news/2018/12/25/ruby-2-6-0-released/)

OLD:

Having this issue too. Everything was working fine before upgrading to Webpacker 6 and I'm using ruby 2.5.8.

I tested the command on ruby 2.6.6 and it worked, so I don't know from which version it starts to work correctly.

Definitely should update the documentation if it's not possible to support older ruby versions.

I think it's fine to require a newer Ruby for v6.

I'm 💯 in

@newfylox could you open a PR for that?

@guillaumebriday Actually I ended up upgrading to Ruby 2.7 because I'm in a rush and won't have time to open a PR.

@justin808 It probably could be a debate about requiring Ruby 2.6, but we should update the documentation in the master branch about having Ruby 2.6+ installed

@guillaumebriday we have required 2.7 for 3 months now.

  s.required_ruby_version = ">= 2.7.0"

https://github.com/rails/webpacker/blame/master/webpacker.gemspec#L18