Skip to content

Different package hash values depending on context #35234

@adam-bloom

Description

@adam-bloom

Current Behavior

Target a package via nx run-many --all vs nx run <project>:<target> and the inputs of that task may hash differently. This appears to be related to #35071 and npm dependency hashing.

Expected Behavior

Same task inputs hash the same, no matter how it is triggered

GitHub Repo

No response

Steps to Reproduce

  1. Monorepo with different npm dependency resolutions
  2. Run the same task via both of the above methods, check for hash differences

Nx Report

NX   Report complete - copy this into the issue template

Node           : 24.13.1
OS             : darwin-arm64
Native Target  : aarch64-macos
pnpm           : 10.30.0
daemon         : Disabled

nx                     : 22.6.4
@nx/js                 : 22.6.4
@nx/eslint             : 22.6.4
@nx/workspace          : 22.6.4
@nx/jest               : 22.6.4
@nx/cypress            : 22.6.4
@nx/devkit             : 22.6.4
@nx/esbuild            : 22.6.4
@nx/eslint-plugin      : 22.6.4
@nx/module-federation  : 22.6.4
@nx/node               : 22.6.4
@nx/playwright         : 22.6.4
@nx/plugin             : 22.6.4
@nx/react              : 22.6.4
@nx/rollup             : 22.6.4
@nx/storybook          : 22.6.4
@nx/vite               : 22.6.4
@nx/vitest             : 22.6.4
@nx/web                : 22.6.4
@nx/docker             : 22.6.4
typescript             : 5.9.3

---------------------------------------
Nx key licensed packages
Licensed to AgileMD, Inc for 30 users in an unlimited number of workspaces.
License expires on 3/12/2028.

@nx/s3-cache  : 5.0.0

---------------------------------------
Registered Plugins:
@nx-tools/nx-container
@nx/eslint/plugin
@nx/js/typescript
@nx-go/nx-go
@nx/storybook/plugin
@nxlv/python
---------------------------------------
Community plugins:
@jnxplus/nx-maven      : 1.16.1
@nx-go/nx-go           : 3.3.1
@nx-tools/nx-container : 7.2.1
@nx/s3-cache           : 5.0.0
@nxlv/python           : 22.1.0
---------------------------------------
Local workspace plugins:
@agilemd/nx
---------------------------------------
Cache Usage: 0.00 B / 92.63 GB

Failure Logs

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

Here's some LLM assisted log analysis of nx trace logs:

  • Job 1 (nx run-many --all): The full workspace task graph causes AllExternalDependencies to include npm packages from ALL projects - input hash for our target: 4236339764162114145
  • Job 2 (nx run:): The scoped task graph only includes npm packages relevant to a single package's dependency tree - input hash for our target: 6770198057449441380

it specifically flagged 26 additional npm packages that were picked up in job 1 but not job 2, none of which are dependencies of the the task in question. Hence the potential relationship to #35071 - --all will pick up sibling dependencies, but direct running won't.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions