-
Notifications
You must be signed in to change notification settings - Fork 609
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
[rush-lib] Fix an bug when using pnpm 9, where a subspace is empty, the rush install fails #5044
base: main
Are you sure you want to change the base?
Conversation
@fzxen Do you know what's intention to change this |
@g-chao rushstack/libraries/rush-lib/src/logic/test/shrinkwrapFile/non-workspace-pnpm-lock-v9.yaml Lines 7 to 29 in 724aa51
|
// Lockfile v9 always has "." in importers filed. | ||
this.isWorkspaceCompatible = | ||
this.shrinkwrapFileMajorVersion >= ShrinkwrapFileMajorVersion.V9 | ||
? this.importers.size > 1 | ||
: this.importers.size > 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary
When using PNPM 9, if a subspace is empty. The rush install will throw follow error:
The shrinkwrap file has not been updated to support workspaces. Run "rush update --full" to update the shrinkwrap file.
However, after
rush update --full
, thenrush install
, the error still there.This is due to, the
isWorkspaceCompatible
logic does not consider the empty lockfile case.Here is the current logic:
In a empty lockfile, the importers.size = 1, so I think we will need to change this logic to
this.isWorkspaceCompatible = this.importers.size > 0
How it was tested
Manually tested with rush repo locally.
Impacted documentation
N/A