Skip to content

Conversation

AgentEnder
Copy link
Member

Current Behavior

When adding a project.json file to configure certain aspects of an existing Nx project, that project's name will be changed. We had to fix this for package-json based projects a while back, and as we expand polyglot its coming up again.

Expected Behavior

The "default name" behavior stamped into the project.json plugin doesn't trample existing names. To do this, it had to be moved out of the project.json plugin and into the validate + normalize flow

Related Issue(s)

Fixes #

@AgentEnder AgentEnder requested a review from a team as a code owner October 17, 2025 14:00
Copy link

vercel bot commented Oct 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nx-dev Ready Ready Preview Oct 17, 2025 10:37pm

💡 Enable Vercel Agent with $100 free credit for automated AI reviews

Copy link

netlify bot commented Oct 17, 2025

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 0b50837
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/68f2c276dfb66d000734fc0c
😎 Deploy Preview https://deploy-preview-33114--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@AgentEnder AgentEnder force-pushed the fix/project-json-without-name-changes-name branch from f594242 to 9a23a22 Compare October 17, 2025 14:00
Copy link
Contributor

nx-cloud bot commented Oct 17, 2025

View your CI Pipeline Execution ↗ for commit 0b50837

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ✅ Succeeded 50m 34s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 2m 46s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 3s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-10-17 23:21:44 UTC

@AgentEnder AgentEnder force-pushed the fix/project-json-without-name-changes-name branch from bb3562a to 3b23451 Compare October 17, 2025 14:43
@AgentEnder AgentEnder enabled auto-merge (squash) October 17, 2025 15:15
nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

Copy link
Contributor

@nx-cloud nx-cloud bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nx Cloud is proposing a fix for your failed CI:

We've identified and fixed a bug in the project name assignment logic. The code was using the wrong variable (root instead of project.root) when generating a default project name from a project.json file, causing tests to fail with "Cannot find configuration for 'app1'" errors.

diff --git a/packages/nx/src/project-graph/utils/project-configuration-utils.ts b/packages/nx/src/project-graph/utils/project-configuration-utils.ts
index cbda398a13..08a79d4103 100644
--- a/packages/nx/src/project-graph/utils/project-configuration-utils.ts
+++ b/packages/nx/src/project-graph/utils/project-configuration-utils.ts
@@ -677,7 +677,7 @@ function validateAndNormalizeProjectRootMap(
       !project.name &&
       existsSync(join(workspaceRoot, project.root, 'project.json'))
     ) {
-      project.name = toProjectName(join(root, 'project.json'));
+      project.name = toProjectName(join(project.root, 'project.json'));
     }
 
     try {

Apply fix via Nx Cloud  Reject fix via Nx Cloud

Or Apply changes locally with:

npx nx-cloud apply-locally YPM2-SuLp

Apply fix locally with your editor ↗  View interactive diff ↗


🎓 To learn more about Self Healing CI, please visit nx.dev

@AgentEnder AgentEnder requested a review from a team as a code owner October 17, 2025 22:04
@AgentEnder AgentEnder force-pushed the fix/project-json-without-name-changes-name branch from acf21f8 to 0b50837 Compare October 17, 2025 22:25
@AgentEnder AgentEnder merged commit 6549d2a into master Oct 17, 2025
13 checks passed
@AgentEnder AgentEnder deleted the fix/project-json-without-name-changes-name branch October 17, 2025 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants