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

Incorrect "circular dependency" error on 20.1.0 #29735

Open
1 of 4 tasks
simon-abbott opened this issue Jan 23, 2025 · 0 comments
Open
1 of 4 tasks

Incorrect "circular dependency" error on 20.1.0 #29735

simon-abbott opened this issue Jan 23, 2025 · 0 comments
Assignees
Labels
scope: core core nx functionality type: bug

Comments

@simon-abbott
Copy link

Current Behavior

Running certain commands on nx 20.1.0 gives a "Could not execute command because the task graph has a circular dependency" error, even though there aren't actually any circular dependencies.

Expected Behavior

Running nx commands should complete successfully.

GitHub Repo

No response

Steps to Reproduce

As best as I can tell these are the reproduction steps:

  1. Run nx reset
  2. Run a cachable command that depends on other packages (I'm using npx nx run-many --target=build --all where build has "dependsOn": ["^build"]).
  3. Run nx reset again, leaving the build outputs alone
  4. Run build again.

On the second invocation of build with a clean cache and existing outputs it will falsely think there is a circular dependency. Also when trying to make a minimal repro of this issue I found that it stops happening for me if I remove the files in .github/ISSUE_TEMPLATES. Which is exceedingly strange. I unfortunately haven't yet found a full minimal reproduction, but I can consistently reproduce it locally in our full (private) workspace.

Here is the script I ran that reliably reproduced the issue:

#!/bin/bash

set -e

npx nx run-many --target=clean --all
npx nx reset
npm install
npx nx run-many --target=build --all
npx nx reset
npx nx run-many --target=build --all

Nx Report

Node           : 22.12.0
OS             : darwin-x64
Native Target  : x86_64-macos
npm            : 10.9.0

nx             : 20.1.0
@nx/js         : 20.1.0
@nx/workspace  : 20.1.0
@nx/devkit     : 20.1.0
typescript     : 5.5.4

Failure Logs

Package Manager Version

No response

Operating System

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

Additional Information

I bisected the nx version and v20.1.0 is the first release with this issue.

I also tried to debug this locally by cloning the nx repo, but I was unable to figure out how to run the locally-built nx on the failing project. If you can provide instructions on how to make that work I'd be happy to look into this further myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: core core nx functionality type: bug
Projects
None yet
Development

No branches or pull requests

3 participants