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

Root-level scripts via Nx are broken since v18 #23078

Open
1 of 4 tasks
Ambroos opened this issue Apr 29, 2024 · 2 comments
Open
1 of 4 tasks

Root-level scripts via Nx are broken since v18 #23078

Ambroos opened this issue Apr 29, 2024 · 2 comments

Comments

@Ambroos
Copy link

Ambroos commented Apr 29, 2024

Current Behavior

Following the steps here: https://nx.dev/recipes/running-tasks/root-level-scripts

Adding a script and nx config to the root level package.json (in a package-based monorepo) no longer makes the script available as a task in Nx 18.

In root package.json:

  "scripts": {
    "test": "echo hi"
  },
  "nx": {},

nx show projects does not show root project
nx run root-name:test errors (cannot find project)

Expected Behavior

What happens in v17:

nx show projects shows root project
nx run root-project-name:test runs

GitHub Repo

https://github.com/Ambroos/nx-root-target-bug-v18

Steps to Reproduce

  1. npm install
  2. nx run workspace-level-test:test -> errors
  3. nx show projects -> empty, does not pick up root package

Working repo in v17: https://github.com/Ambroos/nx-root-target-bug-v17

  1. npm install
  2. nx run workspace-level-test-17:test -> works

Nx Report

NX   Report complete - copy this into the issue template

Node   : 20.12.2
OS     : darwin-arm64
npm    : 10.5.0

nx (global)    : 18.3.3
nx             : 18.3.4
@nx/js         : 18.3.4
@nx/workspace  : 18.3.4
@nx/devkit     : 18.3.4
@nrwl/tao      : 18.3.4

Failure Logs

No response

Package Manager Version

npm 10.5.0

Operating System

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

Additional Information

No response

@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 @Ambroos - I can't reproduce this issue. In your provided v18 repo, the test command is running properly for me.

image

Can you verify that this is still happening for you?

Copy link

This issue has been automatically marked as stale because more information has not been provided within 7 days.
It will be closed in 21 days if no information is provided.
If information has been provided, please reply to keep it active.
Thanks for being a part of the Nx community! 🙏

@github-actions github-actions bot added the stale label May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants