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

18.3.4 Breaking Change with nx:run-commands #23083

Closed
1 of 4 tasks
CreativeTechGuy opened this issue Apr 29, 2024 · 4 comments · Fixed by #23068
Closed
1 of 4 tasks

18.3.4 Breaking Change with nx:run-commands #23083

CreativeTechGuy opened this issue Apr 29, 2024 · 4 comments · Fixed by #23068
Assignees
Labels

Comments

@CreativeTechGuy
Copy link

Current Behavior

Running a target which uses the nx:run-commands executor, results in this error:

The nodes created from packages/my-library/project.json by the "nx/core/project-json" could not be merged into the project graph:
    TypeError: Cannot read properties of undefined (reading 'join')
        at isCompatibleTarget (\node_modules\nx\src\project-graph\utils\project-configuration-utils.js:461:67)
        at mergeTargetConfigurations (\node_modules\nx\src\project-graph\utils\project-configuration-utils.js:398:26)
        at mergeProjectConfigurationIntoRootMap (\node_modules\nx\src\project-graph\utils\project-configuration-utils.js:132:34)

Note: This was introduced in 18.3.4 as it was not present in 18.3.3.

The config setup required is:

nx.json

{
    "targetDefaults": {
        "nx:run-commands": {
            "options": {
                "cwd": "{projectRoot}"
            }
        }
    }
}

project.json

{
    "targets": {
        "build": {
            "executor": "nx:run-commands",
            "options": {
                "command": "echo 'hi'"
            }
        }
    }
}

Expected Behavior

The command which was working in 18.3.3 should still work without any changes necessary.

GitHub Repo

No response

Steps to Reproduce

  1. See above for relevant config sections required
  2. Execute the target using nx via any command (eg: nx run)

Nx Report

Node   : 20.9.0
OS     : win32-x64
npm    : 10.1.0
 
nx                 : 18.3.4
@nx/js             : 18.3.4
@nx/jest           : 18.3.4
@nx/linter         : 18.3.4
@nx/eslint         : 18.3.4
@nx/workspace      : 18.3.4
@nx/devkit         : 18.3.4
@nx/esbuild        : 18.3.4
@nx/eslint-plugin  : 18.3.4
@nx/plugin         : 18.3.4
@nrwl/tao          : 18.3.4
@nx/vite           : 18.3.4
typescript         : 5.4.5

Failure Logs

No response

Package Manager Version

No response

Operating System

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

Additional Information

No response

@CreativeTechGuy
Copy link
Author

The workaround for this seems to be to remove any default configuration from nx.json and in-line it everywhere that the executor is used. But there shouldn't have been a breaking change like this in a patch version.

@AgentEnder AgentEnder self-assigned this Apr 30, 2024
@AgentEnder AgentEnder added the scope: core core nx functionality label Apr 30, 2024
@AgentEnder
Copy link
Member

Hey 👋, this wasn't meant to be a breaking change, rather there was a separate bug that the fix for caused this. Itll get resolved in next patch. Apologies for any turbulence.

@CreativeTechGuy
Copy link
Author

Hey thanks for the reply. I saw the bug fix which seemed like it caused this. But I wasn't sure what the expected behavior was. There was a chance that it was always broken and the 18.3.4 behavior was actually what was always intended.

It's good to hear that it will be fixed and kept the way it was before!

Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants