Webpacker: `yarn check` deprecated

Created on 5 Nov 2019  路  4Comments  路  Source: rails/webpacker

yarn check used here https://github.com/rails/webpacker/blob/master/lib/webpacker/railtie.rb#L33 is deprecated https://github.com/yarnpkg/rfcs/pull/106

We ran into an issue in our project where yarn install worked fine but yarn check was reporting multiple errors. Searching for a solution lead here https://github.com/yarnpkg/yarn/issues/6427#issuecomment-434499073 which lead to the merged deprecation.

bug dependencies help wanted yarn 2.0

Most helpful comment

yarn check is also called out as buggy(https://classic.yarnpkg.com/en/docs/cli/check/) in addition to being deprecated and removed in Yarn 2.0 which has had its first stable release. I found another issue in the repo too which calls out that this will need to change soon https://github.com/rails/webpacker/issues/2007.

Is there an alternative for verifying integrity? The best alternative I know about is yarn install --check-files, but adding that would add the install to this step. I thought about opening a PR to do that, but I wasn't sure if that particular change would go over well

All 4 comments

I'd like to add that this has led to several wasted hours figuring this out - its especially problematic as that check command gets run on every rails command - it has even broken deploys for us

I suggest turning it off in your config/webpacker.yml if it's causing pain:

check_yarn_integrity: false

yarn check is also called out as buggy(https://classic.yarnpkg.com/en/docs/cli/check/) in addition to being deprecated and removed in Yarn 2.0 which has had its first stable release. I found another issue in the repo too which calls out that this will need to change soon https://github.com/rails/webpacker/issues/2007.

Is there an alternative for verifying integrity? The best alternative I know about is yarn install --check-files, but adding that would add the install to this step. I thought about opening a PR to do that, but I wasn't sure if that particular change would go over well

It's constantly causing issues for us now so I tried check_yarn_integrity: false in webpacker.yml (and restarted Spring) but it had no effect. Really slowing down development.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Eearslya picture Eearslya  路  3Comments

christianrojas picture christianrojas  路  3Comments

ankitrg picture ankitrg  路  3Comments

ijdickinson picture ijdickinson  路  3Comments

johan-smits picture johan-smits  路  3Comments