Running bundle exec rake assets:precompile now runs yarn install twice: (This didn't happen with 4.0.7)
yarn install v1.19.1
[1/4] Resolving packages...
success Already up-to-date.
Done in 1.66s.
yarn install v1.19.1
[1/4] Resolving packages...
success Already up-to-date.
Done in 2.00s.
Everything's up-to-date. Nothing to do
Also now when deploying (capistrano) yarn install always fetches packages (it never says "already up-to-date" anymore). This wasn't the case with 4.0.7 (node_modules and public/packs are in the linked_dirs option)
Rails 6.0.1
Webpacker 4.2.0
yup it ran twice on my machine too
Running twice in my app as well
[aolmode]me too[/aolmode]
strange, everything works, but duplicated.
```01 ~/.rvm/bin/rvm 2.6.5 do bundle exec rake assets:precompile
01 yarn install v1.19.2
01 [1/4] Resolving packages...
01 [2/4] Fetching packages...
01 info [email protected]: The platform "linux" is incompatible with this module.
01 info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
01 [3/4] Linking dependencies...
01 [4/4] Building fresh packages...
01 Done in 11.92s.
01 yarn install v1.19.2
01 [1/4] Resolving packages...
01 [2/4] Fetching packages...
01 info [email protected]: The platform "linux" is incompatible with this module.
01 info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
01 [3/4] Linking dependencies...
01 [4/4] Building fresh packages...
01 Done in 4.75s.
01 Compiling...
Yap, can confirm on webpacker 4.2.2. A fix for this would be nice
Running twice in my app as well (2)
@gauravtiwari any idea?
This issue occurs with the following code:
The code is executed before defining the yarn:install in railties, and the condition always returns false.
If you want to fix the issue immediately, you can fix it by removing webpacker:yarn_install in the Rakefile.
require_relative 'config/application'
Rails.application.load_tasks
# Remove `webpacker:yarn_install` task
#
# ref: https://github.com/rails/webpacker/issues/2369
Rake::Task['yarn:install'].tap do |t|
raise 'Consider removing this patch' unless t.prerequisites.include?('webpacker:yarn_install')
prerequisites = t.prerequisites - ['webpacker:yarn_install']
t.clear_prerequisites
t.enhance(prerequisites) unless prerequisites.empty?
end
This is now fixed 馃憤
Thanks for the fix @gauravtiwari, look like the fix made it to master but there hasn't been a release in almost 2 months, do you know if this is likely to be available soon? Cheers!
Most helpful comment
Thanks for the fix @gauravtiwari, look like the fix made it to master but there hasn't been a release in almost 2 months, do you know if this is likely to be available soon? Cheers!