Use current yarn version on deploy to vercel #1007
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Copying behaviors from #998
Current Behavior
deployment log from
main
branchSo our
yarn.lock
file is ignored and the last version will be installed when we have^x.y.z
versions of packages. It can cause errorsExpected Behavior
yarn version
3.2.3
should be usedyarn.lock
should be usedSince our
yarn.lock
is located at the root of the repo, I think we can't use locked versions of nextjs package on our deploys. But it's possible at least to change yarn version to3.2.3
from^1
. I'm still not sure if it adds a lot of value but I think it could solve some issues we had before when using yarn v1 or other incompatible yarn versions.So, to use current version on deploy to vercel we need to add to
package.json
packageManager
ENABLE_EXPERIMENTAL_COREPACK=1
to enable use ofpackageManager
docsYARN_ENABLE_IMMUTABLE_INSTALLS=false
to enable creating newyarn.lock
on deploy. I don't see it in the docs, but this helped to prevent this error:Resulting build logs:
and it builds with no errors
Fixes #998
Additional Information