Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/nxPublic

Inconsistent cache behavior with dependsOn #33379

Open
Labels
@rudfoss-rr

Description

@rudfoss-rr

Current Behavior

Targets that depend on other projects are still served from cache even when their dependencies are recomputed.

The target below depends onbuild from its dependencies. If changes occur in a dependency that invalidates the cache the dependency is rebuilt, but not the base target resulting in cached output using old code.

"build": {"cache":true,"dependsOn": ["^build"],"inputs": ["project"],"outputs": ["{projectRoot}/built/**"],"executor":"nx:run-commands","options": {"cwd":"{projectRoot}","command":"vite build"  }}

Se full description in readme:https://github.com/rudfoss-rr/nx-cache-dependson-issue/blob/main/README.md

Expected Behavior

If a dependency is declared in a target usingdependsOn and that dependency is invalidated, it should also invalidate the source target.

projectA:build -> libraryA:build -> libraryB:build

If everything is initially cached and then a change occurs in libraryB that invalidates thelibraryB:build target then the cache forprojectA:build andlibraryA:build should also be invalidated.

GitHub Repo

https://github.com/rudfoss-rr/nx-cache-dependson-issue

Steps to Reproduce

See attached repository.

Nx Report

NX   Reportcomplete - copy this into the issue templateNode: 24.11.0OS: linux-x64Native Target: x86_64-linuxpnpm: 10.18.3nx: 22.0.2@nx/js: 22.0.2@nx/workspace: 22.0.2@nx/devkit: 22.0.2typescript: 5.9.3---------------------------------------Cache Usage: 0.00 B / 100.69 GB

Failure Logs

N/A

Package Manager Version

pnpm 10.18.3

Operating System

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

Additional Information

I'm unable to determine if this is expected behavior or an actual bug. It seems to me that this is incorrect behavior as the onlyworkaround I've found requires that each target knows which inputs affect the cache of the dependency chain all the way up to the top.

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp