Skip to content

Conversation

@dynst
Copy link
Contributor

@dynst dynst commented Jun 20, 2025

Fix on #788

https://yarnpkg.com/features/pnp

.pnp.loader.mjs never changes, and .pnp.cjs (pnp's replacement for a node_modules/ directory) is just a 22k+ 23k line file derived from from the 8k line yarn.lock, except it's much more prone to git merge conflicts.

The best way to solve merge conflicts is to delete it and regenerate it (in cases where there were no conflicts in yarn.lock), so best practice is to just delete it ahead of time.

.pnp.cjs is redundant with yarn.lock, and as a file format
it's a disaster magnet for git merge conflicts.
@dynst
Copy link
Contributor Author

dynst commented Jun 27, 2025

Merge conflict on the PR to prevent future merge conflicts. Ironic.

@webmaster128
Copy link
Member

Thank you for bringing this up. Turns our that this depends on Zero-Installs vs. non-Zero-Installs. See https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored and https://yarnpkg.com/features/caching#zero-installs.

I'm not necessarily convinced we need Zero-Installs but for now we use it. This is also why the whole cache is checked-in. If we give up Zero-Installs this should be discussed in a separate issue.

So I did #1696 instead. Hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants