Skip to content
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

npm package conflicting actions error #2071

Open
jbedard opened this issue Jan 15, 2025 · 2 comments
Open

npm package conflicting actions error #2071

jbedard opened this issue Jan 15, 2025 · 2 comments
Assignees
Labels
bug report Bug report from a customer or potential customer

Comments

@jbedard
Copy link
Member

jbedard commented Jan 15, 2025

Multiple copies of a package with different peer resolutions seems to (sometimes?) cause duplicate action errors.

For example, with lockfileVersion: 5.4:

ERROR: file 'common/node_modules/.aspect_rules_js/[email protected]/node_modules/npm-package-with-peers' is generated by these conflicting actions:
Label: //common:.aspect_rules_js/node_modules/[email protected]
RuleClass: npm_package_store rule
JavaActionClass: class com.google.devtools.build.lib.analysis.starlark.UnresolvedSymlinkAction
Configuration: aa822ae26d2d99f435ffb66e325974a9e239406c231bd751188139f8699b3970
Mnemonic: UnresolvedSymlink
Action key: 322d26204272a489bcd713fa43ced9bf80baad06366acc93ca06cc61d21876ff, 3bf61121e35f3f9aa3c62539393a305c0989c00665fe93e0836fd29538173c53
Progress message: Creating symlink bazel-out/k8-opt/bin/common/node_modules/.aspect_rules_js/[email protected]/node_modules/npm-package-with-peers
Action describeKey: GUID: 0f302651-602c-404b-881c-58913193cfe7
target: ../../../[email protected]_typescript_5.6.3/node_modules/npm-package-with-peers
, GUID: 0f302651-602c-404b-881c-58913193cfe7
target: ../../../[email protected]_gopv7vjwecrx6sa4nb5urbdxty/node_modules/npm-package-with-peers

PrimaryInput: (null)
PrimaryOutput: File:[[<execution_root>]bazel-out/k8-opt/bin]common/node_modules/.aspect_rules_js/[email protected]/node_modules/npm-package-with-peers
Owner information: ConfiguredTargetKey{label=//common:.aspect_rules_js/node_modules/[email protected], config=BuildConfigurationKey[aa822ae26d2d99f435ffb66e325974a9e239406c231bd751188139f8699b3970]}
MandatoryInputs: are equal
Outputs: are equal
@jbedard jbedard added the bug report Bug report from a customer or potential customer label Jan 15, 2025
@jbedard jbedard self-assigned this Jan 15, 2025
@westrik
Copy link

westrik commented Jan 15, 2025

i'm seeing this issue as well:

Label: //:.aspect_rules_js/node_modules/@[email protected]
RuleClass: npm_package_store rule
JavaActionClass: class com.google.devtools.build.lib.analysis.starlark.UnresolvedSymlinkAction
Configuration: 3495bc65c90ec3e3e1a75464a6a9b3ea7aafe982fac3db4ecb150e956b2f4e69
Mnemonic: UnresolvedSymlink
Action key: 6dffbed7f4fb43a3ee13cbfbc7709a4b1072bede5526ba0f1dfae7b0d74c6fed, 0843a78e410922fe80dc9110bfdd563991a6fb291c45305270c07d846bbf916f
Progress message: Creating symlink bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@[email protected]/node_modules/eslint-plugin-import
Action describeKey: GUID: 0f302651-602c-404b-881c-58913193cfe7
target: ../../[email protected]_1375315877/node_modules/eslint-plugin-import
, GUID: 0f302651-602c-404b-881c-58913193cfe7
target: ../../[email protected]_1510948504/node_modules/eslint-plugin-import
PrimaryInput: (null)
PrimaryOutput: File:[[<execution_root>]bazel-out/darwin_arm64-fastbuild/bin]node_modules/.aspect_rules_js/@[email protected]/node_modules/eslint-plugin-import
Owner information: ConfiguredTargetKey{label=//:.aspect_rules_js/node_modules/@[email protected], config=BuildConfigurationKey[3495bc65c90ec3e3e1a75464a6a9b3ea7aafe982fac3db4ecb150e956b2f4e69]}
MandatoryInputs: are equal
Outputs: are equal

My pnpm lockfile version is '9.0' and the lockfile contains three snapshots entries for eslint-plugin-import:

This is the importers entry for @monorepo/runtime's devDependency on eslint-plugin-import:

      eslint-plugin-import:
        specifier: ^2.28.1
        version: 2.28.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])([email protected])

Some dependencies/devDependencies for @monorepo/runtime specify slightly different peer dependencies on eslint-plugin-import:

Also we have this pnpm.packageExtensions entry in the root package.json:

      "eslint-plugin-import@^2.28.0": {
        "peerDependencies": {
          "eslint-import-resolver-typescript": "3.6.0"
        }
      },

@jbedard
Copy link
Member Author

jbedard commented Jan 16, 2025

Using things like packageExtensions to normalize all those different combinations of peer dependencies into one will most likely workaround the issue, but I can't be certain atm :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Bug report from a customer or potential customer
Projects
None yet
Development

No branches or pull requests

2 participants