Feature request: opt-in early failure for cyclic project graph dependencies #34829
Stanzilla
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Current Behavior
Nx can fail when a derived command graph or task graph is cyclic, but it does not fail early just because the workspace project graph itself contains a cycle.
That means a workspace can have cyclic project dependencies and Nx may continue to work until a specific command eventually produces a cyclic task graph.
I also know about the
@nx/enforce-module-boundariesESLint rule, but that does not fully satisfy this need. It is a lint rule over source imports, not core project-graph validation, and it is optional, lint-pipeline-dependent, and narrower than validating the workspace dependency graph itself.By comparison, Turborepo validates the workspace package graph up front and refuses to continue when it finds a cyclic workspace dependency.
Expected Behavior
Nx should offer an opt-in way to fail early when the workspace/project graph itself contains cyclic project dependencies.
Something conceptually like:
{ "strictProjectGraphCycles": true }The name does not matter. The important part is validating the project graph itself, not only the derived task graph.
Why This Would Help
Beta Was this translation helpful? Give feedback.
All reactions