-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Yarn install skips plugins during deployment #1441
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
Comments
I realize I missed this issue which led me to a temporary solution: However, instead of modifying the Rake task to call yarn install with different options, I just modified it to completely skip yarn install:
And then if I use this to run Yarn install manually during deploy, prior to asset precompilation, everything seems to succeed. |
I think the problem is that you have babel plugins in |
@somebody32 that obviously will work, but in old versions you could separate your dev and general deps |
@chadwilken not sure what you mean by "old versions", that is how yarn behaves, not webpacker here |
@somebody32 I know that's what yarn is supposed to do. I didn't see he was on Rails 4.x. In older versions of Rails (5.1.x) w/ Webpacker they had a task in Rails for yarn install that installed all dependencies. |
@chadwilken Yeah the rake task is updated with production flag which breaks the default behavior. I think we should remove that and let yarn use // cc @guilleiguaran |
I ended up following @somebody32 suggestion (Ruby on Rails 5.2.1, Webpacker 3.5.5).
A thing that I found out is that it doesn't work if you don't remove Here's the sequence I followed:
|
Step 6 should be done by Maybe that's due to the fact I was prepending Anyway I got to that conclusion after reading @gauravtiwari comment here. |
During deployment, Yarn install seems to be installing only a partial/incomplete list of dependencies into my node_modules folder.
If I manually SSH into the server and go to the release folder for the deployment that just failed, I can run
yarn
and it will properly install all necessary dependencies. It is only during Capistrano deployment when yarn will skip necessary dependencies, as if it is referencing a generic list.Furthermore, I tried the approach outlined here:
#1037 (comment)
This actually will work properly, but then gets over-written by
bundle exec rake assets:precompile
. First it will run the custom task, and next it will run the assets:precompile. As I investigated, I made the deployment fail by forcing an error into the first script:At this point if I SSH into the server and look at my node_modules folder, all the necessary dependencies have been installed from the custom task. It is only once
bundle exec rake assets:precompile
runs where yarn install runs again and does not include all of the necessary dependencies.I experimented with adding this to my environment file but it did not seem to matter:
config.webpacker.check_yarn_integrity = false
Application / Environment info:
I don't see very much Rails 4 discussion here so I don't know if that is going to be a problem.
.babelrc contents:
package.json contents:
The deployment output:
The text was updated successfully, but these errors were encountered: