fix(pnp): skip uninstalled unrelated packages when looking up binaries - #7265
Open
cdcxd wants to merge 3 commits into
Open
fix(pnp): skip uninstalled unrelated packages when looking up binaries#7265cdcxd wants to merge 3 commits into
cdcxd wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What's the problem this PR addresses?
Closes #7264
...
How did you fix it?
I made pnp linker follow the same thing done for node modules linker:
berry/packages/plugin-nm/sources/NodeModulesLinker.ts
Line 76 in 57081c0
That signal the package can't be located and allows it to skip (already in
berry/packages/yarnpkg-core/sources/scriptUtils.ts
Line 697 in 57081c0
Also added a unit test to guard this behavior.
No PR for yarn v6. This problem doesn't exist in yarn v6, it has solved the problem structurally https://github.com/yarnpkg/zpm/blob/def394488933b0c5037e70d82a2f4842089497e4/packages/zpm/src/project.rs#L1352
...
Verification
I'm testing it using the example in #7264 , that we start a devserver and the error is on the unrelated eslint.
yarn run startCouldn't find eslint@npm:8.57.1 in the currently installed PnP mapyarn next --versionNext.js v14.2.15Next.js v14.2.15yarn bin nextnextbin pathyarn bin(list)nextnextyarn node -e "require.resolve('next')"yarn eslint --versionCouldn't find a script named "eslint"yarn node -e "require.resolve('eslint')"…tried to access eslint, but it isn't declared…Checklist