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

@nx/js:node: serve does not terminate if waitUntilTargets are specified #18249

Closed
1 of 4 tasks
chromey opened this issue Jul 22, 2023 · 3 comments
Closed
1 of 4 tasks

Comments

@chromey
Copy link
Contributor

chromey commented Jul 22, 2023

Current Behavior

#17553 re-introduced support for waitUntilTargets after it had been accidentally removed in #17524. However, nx serve is now no longer correctly handling SIGTERM events. When CTRL-C-ing out of the process, it prints

 NX  Process exited with code null, waiting for changes to restart...

and returns to the console, but the process does not terminate, as is evident by re-running nx serve (fails with an EADDRINUSE error).

Expected Behavior

Cancelling nx serve should terminate the watch process and all spawned children.

GitHub Repo

No response

Steps to Reproduce

  1. create a new workspace and demo app with the nest preset
  2. add a trivial waitUntilTarget using the nx:run-commands executor, e.g.
    "serve": {
      "executor": "@nx/js:node",
      "defaultConfiguration": "development",
      "options": {
        "buildTarget": "demo:build",
        "waitUntilTargets": ["demo:do-stuff"]
      },
      "configurations": {
        "development": {
          "buildTarget": "demo:build:development"
        },
        "production": {
          "buildTarget": "demo:build:production"
        }
      }
    },
    "do-stuff": {
      "executor": "nx:run-commands",
      "options": {
        "command": "ls"
      }
    },
  1. Run nx serve, then terminate the process
  2. Run nx serve again

Nx Report

Node   : 18.16.0
   OS     : darwin-arm64
   npm    : 9.5.1
   
   nx (global)        : 16.5.3
   nx                 : 16.5.4
   @nx/js             : 16.5.4
   @nx/jest           : 16.5.4
   @nx/linter         : 16.5.4
   @nx/workspace      : 16.5.4
   @nx/devkit         : 16.5.4
   @nx/eslint-plugin  : 16.5.4
   @nx/nest           : 16.5.4
   @nx/node           : 16.5.4
   @nrwl/tao          : 16.5.4
   @nx/webpack        : 16.5.4
   typescript         : 5.1.6

Failure Logs

No response

Operating System

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

Additional Information

No response

@chromey chromey changed the title @nx/js:node: serve process does not terminate if waitUntilTargets are specified @nx/js:node: serve does not terminate if waitUntilTargets are specified Jul 22, 2023
@chromey
Copy link
Contributor Author

chromey commented Jul 22, 2023

In the meantime I will move on with using dependsOn as suggested by @jaysoo in #17524, which does not exhibit this problem

Copy link

github-actions bot commented Feb 8, 2024

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nx community! 🙏

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 Mar 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants