Skip to content

When upgrading to v21.4.0, executor @nx/js:node does not work anymore with option "watch": false #32385

@wewelll

Description

@wewelll

Current Behavior

my config is the following :

{
  "targets": {
    "build": {
      "executor": "@nx/esbuild:esbuild",
      "outputs": ["{options.outputPath}"],
      "defaultConfiguration": "production",
      "options": {
        "outputPath": "dist/clis/cli-internal",
        "main": "clis/cli-internal/src/main.ts",
        "tsConfig": "clis/cli-internal/tsconfig.app.json"
      },
      "configurations": {
        "development": {},
        "production": {}
      }
    },
    "serve": {
      "executor": "@nx/js:node",
      "defaultConfiguration": "development",
      "options": {
        "buildTarget": "cli-internal:build",
        "watch": false
      },
      "configurations": {
        "development": {
          "buildTarget": "cli-internal:build:development"
        },
        "production": {
          "buildTarget": "cli-internal:build:production"
        }
      }
    }
  }
}

with nx v21.3.2, the serve target works fine, but when I upgrade to v21.4.0, it does not work anymore.
The command succeeds, but the compiled js file is not run.
If I remove the "watch": false, it will run correctly

Expected Behavior

I expect the compiled js file to be run, like in the v21.3.2 version. This looks like a breaking change.

GitHub Repo

No response

Steps to Reproduce

add "watch": false in the options of a target executing with @nx/js:node, with NX v21.4.0

Nx Report

Node           : 22.17.1
OS             : darwin-arm64
Native Target  : aarch64-macos
pnpm           : 10.14.0

nx                     : 21.4.0
@nx/js                 : 21.4.0
@nx/jest               : 21.4.0
@nx/eslint             : 21.4.0
@nx/workspace          : 21.4.0
@nx/cypress            : 21.4.0
@nx/devkit             : 21.4.0
@nx/esbuild            : 21.4.0
@nx/eslint-plugin      : 21.4.0
@nx/module-federation  : 21.4.0
@nx/node               : 21.4.0
@nx/plugin             : 21.4.0
@nx/react              : 21.4.0
@nx/rollup             : 21.4.0
@nx/storybook          : 21.4.0
@nx/vite               : 21.4.0
@nx/web                : 21.4.0
@nx/docker             : 21.4.0
typescript             : 5.8.2

Failure Logs

Package Manager Version

pnpm 10.14.0

Operating System

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

Additional Information

No response

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions