nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.21k stars 2.31k forks source link

NX always caches projectRoot/package.json #27224

Closed simeon-raykov closed 2 weeks ago

simeon-raykov commented 1 month ago

Current Behavior

We are trying to re-execute a given task when projectRoot/package.json is modified, but we can't do so unless we use the --skip-nx-cache flag.

Expected Behavior

NX does not cache projectRoot/package.json if it is included in the command's inputs in nx.json.

GitHub Repo

No response

Steps to Reproduce

  1. Create a new lib using default NX lib executor
  2. Add "{projectRoot}/package.json" to the targetDefaults.build.inputs array in nx.json
  3. Build the lib
  4. Modify the lib's package.json
  5. Run the build again
  6. NX reads output from cache instead of re-executing the command.

Nx Report

Node   : 20.11.0
OS     : darwin-arm64
yarn   : 3.6.1

nx (global)        : 19.5.2
nx                 : 19.1.1
@nx/js             : 19.1.1
@nx/jest           : 19.1.1
@nx/linter         : 19.1.1
@nx/eslint         : 19.1.1
@nx/workspace      : 19.1.1
@nx/cypress        : 19.1.1
@nx/devkit         : 19.1.1
@nx/eslint-plugin  : 19.1.1
@nx/next           : 19.1.1
@nx/playwright     : 19.1.1
@nx/plugin         : 19.1.1
@nx/react          : 19.1.1
@nx/storybook      : 19.1.1
@nrwl/tao          : 19.1.1
@nx/vite           : 19.1.1
@nx/web            : 19.1.1
@nx/webpack        : 19.1.1
nx-cloud           : 19.0.0
typescript         : 5.1.6
---------------------------------------
Community plugins:
@jscutlery/semver      : 5.2.2
@nx-tools/nx-container : 6.0.1
---------------------------------------
Local workspace plugins:
         @ps/web-martech-cms-types
         @ps/web-shared-analytics
         @ps/web-shared-api-types
         @ps/web-core-tools
         @ps/web-core-intl

Failure Logs

No response

Package Manager Version

No response

Operating System

Additional Information

No response

leosvelperez commented 4 weeks ago

Thanks for reporting this!

Unfortunately, I can't reproduce the issue with the information provided. Please provide a repro where the issue can be reproduced.

github-actions[bot] commented 3 weeks ago

This issue has been automatically marked as stale because no reproduction was provided within 7 days. Please help us help you. Providing a repository exhibiting the issue helps us diagnose and fix the issue. Any time that we spend reproducing this issue is time taken away from addressing this issue and other issues. This issue will be closed in 21 days if a reproduction is not provided. If a reproduction has been provided, please reply to keep it active. Thanks for being a part of the Nx community! 🙏

simeon-raykov commented 2 weeks ago

Hello, we had libs/**/package.json in .nxignore. I am closing this issue