fix(core): include continuous and default-config dependencies in show target - #36374
Merged
Conversation
… target `nx show target` reported no direct dependencies for a target whose `dependsOn` resolves to a continuous task, or whose target declares a `defaultConfiguration`. In both cases the dependency instead leaked into the transitive task list, and the root task leaked into its own transitive tasks. The root task id was rebuilt from the raw `configuration` argument, so a target with a `defaultConfiguration` never matched the `project:target:<config>` id that `createTaskGraph` resolves it to, leaving the dependency lookup empty. Separately, a `dependsOn` edge that resolves to a continuous task is stored in `continuousDependencies` rather than `dependencies`, which the command never read. Resolve the root task from the task graph by project and target instead of reconstructing its id, and union both dependency maps for the direct dependencies.
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
View your CI Pipeline Execution ↗ for commit f47dc54
☁️ Nx Cloud last updated this comment at |
Contributor
There was a problem hiding this comment.
Nx Cloud has identified a flaky task in your failed CI:
🔂 Since the failure was identified as flaky, we triggered a CI rerun by adding an empty commit to this branch.
🎓 Learn more about Self-Healing CI on nx.dev
… target [Self-Healing CI Rerun]
AgentEnder
approved these changes
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current Behavior
nx show target <project>:<target>reports noDepends Onentries in two cases:defaultConfigurationdependsOnentry resolves to acontinuoustask, such as a dev serverIn both cases the dependency is not dropped from the output entirely, it is misfiled: it shows up in the transitive task summary instead. With a
defaultConfiguration, the target's own root task also leaks into its transitive task list.This is visible on a Playwright e2e target whose
dependsOnpoints at a continuous serve task:nx show projectlists the dependency, whilenx show targetshows nothing underDepends On.Both regressed in #35367, when
show targetmoved from static config resolution to task-graph resolution.Expected Behavior
nx show targetlists continuous and default-configuration dependencies underDepends On, matching whatnx show projectreports, and the transitive task summary contains only genuinely transitive tasks.Implementation Details
Two separate causes, both in
resolveTaskGraphDependencies:createTaskId(project, target, configuration)from the rawconfigurationargument.createTaskGraphresolves the target'sdefaultConfiguration, so the real root task id carries a:<config>suffix that the reconstructed id lacked. The lookup missed, leavingdependsOnempty and letting the root task fall through into its owntransitiveTasks. The root task is now resolved from the task graph by(project, target)instead of being reconstructed.dependsOnedge that resolves to a continuous task is stored intaskGraph.continuousDependencies, nottaskGraph.dependencies, and the command only read the latter. The direct dependencies are now the union of both maps.The two compound: with the wrong root id,
continuousDependencies[rootId]is also undefined, so reading the continuous map only takes effect once the root id is correct.Added a regression test covering both: a target with a
defaultConfigurationdepending on acontinuoustarget in another project. It fails on the current code (dependsOncomes back undefined) and passes with the fix.View session information ↗