Webpacker: Missed "yarn install" when deploy

Created on 10 Jul 2018  路  3Comments  路  Source: rails/webpacker

On our project, we updated the rails version and webpacker version. We updated the gem, js package (@rails/webpacker) and bin files (webpack and webpack-dev-server):

```bundle update webpacker
rails webpacker:binstubs
yarn upgrade @rails/webpacker --latest

And during deployment, new packages from package.json was not installed, but the bundle was recompiled and we got an error 'can't resolve package ...'. So "yarn install" task was missed...

rails version - 4.2.10
gem webpacker version - 3.5.3
yan package version:

"@rails/webpacker@^3.5.3":
version "3.5.5"
resolved "https://registry.yarnpkg.com/@rails/webpacker/-/webpacker-3.5.5.tgz#8911c66bcefc8bc6b91270e92f0d39e3c2d43116"
```

Also, I added a new staging environment similar to production. And the above error occurs when we deploy staging.

Maybe we missed something? What could be a problem?

UPD:

  • update gem version to 3.5.5. no changes...
  • also tried remove staging config from webpacker.yml and staging.js from /config/webpack. no changes

All 3 comments

Reproduced on Google App Engine.

Not the maintainer, but saw this and felt compelled to ask: How are you deploying?

I added a "yarn install" task to my capistrano config, because I figured, rightly, that webpacker wouldn't inject it because it knows nothing about capistrano, and that it was my responsibility to integrate them.

rails assets:precompile WILL trigger a yarn install though, so that is good to know. If your capistrano config compiles assets on the server, it will compile webpacker assets too, provided the dependencies are installed!

Is this issue can be closed ?

Was this page helpful?
0 / 5 - 0 ratings