Closed miluoshi closed 2 weeks ago
I've run into this again. Since cacheableOperations
option was replaced with targetDefaults.<target_name>.cache = true
inside nx.json
, I've tried it again with Nx 17.1.2 and the result is the same - files not included in inputs still invalidate task graph.
I've tried to define inputs
on 2 places:
nx.json
: targetDefaults.<target_name>.inputs
package.json
: nx.targets.<target_name>.inputs
with both options the result is the same - cache is invalidated regardless of inputs.
Could someone please validate whether this is a reproducible bug? ๐
I can't validate this issue - using the Nx repo as an example we recently defined inputs + outputs for our pnpm documentation
script. I validated that changing the e2e files didn't invalidate the script. Can you try with latest?
This issue has been automatically marked as stale because no results of retrying on the latest version of Nx was provided within 7 days. It will be closed in 21 days if no results are provided. If the issue is still present, please reply to keep it active. If the issue was not present, please close this issue. Thanks for being a part of the Nx community! ๐
Current Behavior
When I set
inputs
property for root-level target defined as NPM script in package.json, cache hash is changed when any file in the repository is updated. The target is defined incacheableOperations
so it will run cached with consecutive runs with no file changes.Expected Behavior
According to the docs we should be able to define inputs in
package.json
'snx.targets.<target_name>.inputs
property.I've tried defining inputs either in
package.json
or innx.json
'stargetDefaults
, but none of it affected hash calculationGitHub Repo
No response
Steps to Reproduce
I was trying to implement a root-level target that validates URL links in all markdown files:
Add a new npm script to
package.json
and enable root-level targets by adding the "nx" property:Add this target to a
cacheableOperations
innx.json
:Define
inputs
for this target either...a.) in
package.json
:b.) or in
nx.json
:Run
yarn nx markdown-link-check
oryarn nx run <wokrspace_name>:markdown-link-check
and observe that the target runs successfullyRun it again and observe the Nx cache hit
Update any file not targeted by the
inputs
patternRun the command again and observe that it is not retrieved from the cache, but it has been run fully
Nx Report
Failure Logs
No response
Operating System
Additional Information
No response