-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Feature] File protocol should not include gitignored / npmignored files #3356
Comments
We had a similar problem. The checksum calculation differs between Linux CI/CD and Windows Developer System. Our Solution: We moved the |
We have run into exactly same issue. After upgrading from classic Yarn (v1) to latest one (3.2.0), our CI is failing with one of the In my opinion, the |
We are also facing the very same issue (when upgrading from v1.x to v3.x), is there any resolution for it yet ? |
This comment was marked as abuse.
This comment was marked as abuse.
Seems like the only workaround is using a portal resolution link e.g. "resolutions": {
"lib": "portal:../../packages/lib"
} |
The |
@krassowski Yeah it will be a issue for monorepo tools that don't support |
My use case is bundling some relative workspace dependencies via:
Works great but I had a big |
FWIW, I’m working on a monorepo with a failing GitHub build action. The error comes from Yarn, which is complaining about a changed lockfile:
This action was working before but broke when we had to downgrade from the workspace protocol to the file protocol because Vercel doesn’t support anything newer than Yarn 1. |
Describe the user story
I have an
app
that depends onlib
via thefile:
protocol:In
app/yarn.lock
, I'll get something like this after runningyarn
:The problem is that the hash and a checksum in the lockfile are calculated from the
a
directory as a whole, including files like.DS_Store
, node_modules or any gitignored files. Changing any of those will produce a new "folderHash" and a checksum:In practice, we see a changed
yarn.lock
all the time and need to revert it manually. We wish these changes in gitignored / npmignored files didn't change the lockfile.Also, I think that copying node_modules from the referenced package might lead to "incorrect installs" –
lib
might havenode_modules
installed or not, which might affect which versions of packagesapp
resolves. (In general, I could have also messed withlib/node_modules
manually and it feels wrong that this should affectapp
.)Describe the solution you'd like
I think that the hash should use the same helper functions as
yarn pack
(probably functions likegetPackList
inplugin-pack/sources/packUtils.ts
).Describe the drawbacks of your solution
It's a change in behavior and maybe someone wants their dependencies to be re-fetched into the cache even if files like
.DS_Store
or something insidenode_modules
changes? I'm not sure.Describe alternatives you've considered
Currently, in README, we instruct developers to revert
yarn.lock
changes that are caused by their local gitignored files.(Note: this was initially discussed in Discord, see this message and below.)
Search terms: file protocol, gitignored files, gitignore, npmignored files, npmignore,
yarn pack
The text was updated successfully, but these errors were encountered: