Yarn check compatability issues
The yarn check
process which we run automatically as part of rake yarn
and rake gitlab:assets:compile
has been problematic in recent versions.
See issues #38050 (closed), #38275 (closed), and #38457 (closed)
The dependencies install correctly, but for some reason a subsequent yarn check
will fail citing something wrong with the ajv
module which is required as a sub-dependency of webpack
, karma
, and eslint
. The conflicting versions seem to cause confusion for yarn.
References:
- Webpack issue: https://github.com/webpack/webpack/issues/5262
- Yarn issues: https://github.com/yarnpkg/yarn/issues/3916 & https://github.com/yarnpkg/yarn/issues/3933
Starting around the release of yarn v1.0 and GitLab v10.0 we started seeing a lot of complaints from people attempting to install from source.
I've just run some tests with various versions of yarn
against our 10-0-stable
branch and our current master
branch (as of 88870c87 - Feb 21, 2018).
yarn check |
10-0-stable branch |
master branch |
---|---|---|
yarn v1.0.0 | pass (warnings) | fail |
yarn v1.1.0 | fail | fail |
yarn v1.2.0 | fail | fail |
yarn v1.3.2 | fail | pass |
This is troubling. It seems the underlying issue still exists (as even the latest version of yarn
fails when running yarn check
on our 10-0-stable
branch.
One workaround was discovered by manually installing ajv
at a specific version which would bypass the incorrectly linked one in node_modules
.
see: https://gitlab.com/gitlab-org/gitlab-ce/issues/38275#note_41338711
One hypothesis may be that the problem was caused when yarn.lock
was generated with an older, faulty version of yarn and could be resolved by altering the faulty lockfile lines.
For now, if this comes up we ought to point people to this issue, and document that users should be running v1.3.2
or later (latest as of Nov 2017). If we have issues on older stable branches, we should try addressing them with the above workaround.