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:nest:serve Daemon process terminated and closed the connection #23287

Open
1 of 4 tasks
junxiaotan opened this issue May 10, 2024 · 9 comments
Open
1 of 4 tasks

nx:nest:serve Daemon process terminated and closed the connection #23287

junxiaotan opened this issue May 10, 2024 · 9 comments

Comments

@junxiaotan
Copy link

junxiaotan commented May 10, 2024

Current Behavior

nx nest serve error

Expected Behavior

nx nest ok

GitHub Repo

No response

Steps to Reproduce

  • npx create-nx-workspace@latest --pm pnpm (None)
  • npx nx --version // Local: v19.0.2
  • npx nx add @nx/nest
  • npx nx g @nx/nest:app nest-demo
  • npx nx run nest-demo:serve:development (error)
> nx run nest-demo:serve:development


 NX   Daemon process terminated and closed the connection

Please rerun the command, which will restart the daemon.
If you get this error again, check for any errors in the daemon process logs found in: /Users/liujunzheng/webserver/localhost/nx/latest-demo/.nx/cache/d/daemon.log

Watch error: Daemon closed the connection

—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 NX   Running target serve for project nest-demo failed

Failed tasks:

- nest-demo:serve:development

Hint: run the command with --verbose for more details.

Nx Report

- `cat .nx/cache/d/daemon.log`

[NX Daemon Server] - 2024-05-10T03:24:45.078Z - Started listening on: /var/folders/8x/wc_x_1ks3mz6b2nl44m1_jlm0000gn/T/a0f62d6f84d85a775608/d.sock
[NX Daemon Server] - 2024-05-10T03:24:45.079Z - [WATCHER]: Subscribed to changes within: /Users/liujunzheng/webserver/localhost/nx/latest-demo (native)
[NX Daemon Server] - 2024-05-10T03:24:45.088Z - Established a connection. Number of open connections: 1
[NX Daemon Server] - 2024-05-10T03:24:45.089Z - Established a connection. Number of open connections: 2
[NX Daemon Server] - 2024-05-10T03:24:45.090Z - Closed a connection. Number of open connections: 1
[NX Daemon Server] - 2024-05-10T03:24:45.090Z - [REQUEST]: Client Request for Project Graph Received
[NX Daemon Server] - 2024-05-10T03:24:45.098Z - [REQUEST]: Updated workspace context based on watched changes, recomputing project graph...
[NX Daemon Server] - 2024-05-10T03:24:45.098Z - [REQUEST]:
[NX Daemon Server] - 2024-05-10T03:24:45.098Z - [REQUEST]:
[NX Daemon Server] - 2024-05-10T03:24:45.145Z - [REQUEST]: Responding to the client. project-graph
[NX Daemon Server] - 2024-05-10T03:24:45.146Z - Time taken for 'total for creating and serializing project graph' 55.22450000047684ms
[NX Daemon Server] - 2024-05-10T03:24:45.146Z - [WATCHER]: .nx/cache/d/server-process.json was created or restored
[NX Daemon Server] - 2024-05-10T03:24:45.150Z - Done responding to the client project-graph
[NX Daemon Server] - 2024-05-10T03:24:45.150Z - Handled REQUEST_PROJECT_GRAPH. Handling time: 55. Response time: 5.
[NX Daemon Server] - 2024-05-10T03:24:45.245Z - [WATCHER]: package.json was modified
[NX Daemon Server] - 2024-05-10T03:24:45.245Z - [WATCHER]: Processing file changes in outputs
[NX Daemon Server] - 2024-05-10T03:24:45.247Z - [REQUEST]: Updated workspace context based on watched changes, recomputing project graph...
[NX Daemon Server] - 2024-05-10T03:24:45.247Z - [REQUEST]: .nx/cache/d/server-process.json,package.json
[NX Daemon Server] - 2024-05-10T03:24:45.247Z - [REQUEST]:
[NX Daemon Server] - 2024-05-10T03:24:45.254Z - Time taken for 'Load Nx Plugin: /Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/plugins/project-json/build-nodes/package-json-next-to-project-json' 0.3447500001639128ms
[NX Daemon Server] - 2024-05-10T03:24:45.619Z - [WATCHER]: _tmp_25737_a1bdef740763a144093468bf82156b08 was deleted
[NX Daemon Server] - 2024-05-10T03:24:45.619Z - [WATCHER]: Processing file changes in outputs
[NX Daemon Server] - 2024-05-10T03:24:45.821Z - [REQUEST]: Updated workspace context based on watched changes, recomputing project graph...
[NX Daemon Server] - 2024-05-10T03:24:45.821Z - [REQUEST]:
[NX Daemon Server] - 2024-05-10T03:24:45.821Z - [REQUEST]: _tmp_25737_a1bdef740763a144093468bf82156b08
[NX Daemon Server] - 2024-05-10T03:24:45.830Z - Time taken for 'Load Nx Plugin: /Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/plugins/project-json/build-nodes/package-json-next-to-project-json' 0.48554200027137995ms
[NX Daemon Server] - 2024-05-10T03:24:46.624Z - Closed a connection. Number of open connections: 0
[NX Daemon Server] - 2024-05-10T03:24:46.641Z - [WATCHER]: Processing file changes in outputs
[NX Daemon Server] - 2024-05-10T03:24:46.641Z - [WATCHER]: Stopping the watcher for /Users/liujunzheng/webserver/localhost/nx/latest-demo (sources)
[NX Daemon Server] - 2024-05-10T03:24:46.641Z - [WATCHER]: Stopping the watcher for /Users/liujunzheng/webserver/localhost/nx/latest-demo (outputs)
[NX Daemon Server] - 2024-05-10T03:24:46.641Z - Server stopped because: "Lock file changed"
[NX Daemon Server] - 2024-05-10T03:24:56.353Z - Started listening on: /var/folders/8x/wc_x_1ks3mz6b2nl44m1_jlm0000gn/T/a0f62d6f84d85a775608/d.sock
[NX Daemon Server] - 2024-05-10T03:24:56.354Z - [WATCHER]: Subscribed to changes within: /Users/liujunzheng/webserver/localhost/nx/latest-demo (native)
[NX Daemon Server] - 2024-05-10T03:24:56.361Z - Established a connection. Number of open connections: 1
[NX Daemon Server] - 2024-05-10T03:24:56.361Z - Established a connection. Number of open connections: 2
[NX Daemon Server] - 2024-05-10T03:24:56.362Z - Closed a connection. Number of open connections: 1
[NX Daemon Server] - 2024-05-10T03:24:56.362Z - [REQUEST]: Client Request for Project Graph Received
[NX Daemon Server] - 2024-05-10T03:24:56.367Z - [REQUEST]: Updated workspace context based on watched changes, recomputing project graph...
[NX Daemon Server] - 2024-05-10T03:24:56.367Z - [REQUEST]:
[NX Daemon Server] - 2024-05-10T03:24:56.367Z - [REQUEST]:
[NX Daemon Server] - 2024-05-10T03:24:56.410Z - [REQUEST]: Responding to the client. project-graph
[NX Daemon Server] - 2024-05-10T03:24:56.411Z - Time taken for 'total for creating and serializing project graph' 47.815875000320375ms
[NX Daemon Server] - 2024-05-10T03:24:56.414Z - Done responding to the client project-graph
[NX Daemon Server] - 2024-05-10T03:24:56.414Z - Handled REQUEST_PROJECT_GRAPH. Handling time: 48. Response time: 4.
[NX Daemon Server] - 2024-05-10T03:24:56.415Z - [WATCHER]: .nx/cache/d/server-process.json was created or restored
[NX Daemon Server] - 2024-05-10T03:24:56.517Z - [REQUEST]: Updated workspace context based on watched changes, recomputing project graph...
[NX Daemon Server] - 2024-05-10T03:24:56.518Z - [REQUEST]: .nx/cache/d/server-process.json
[NX Daemon Server] - 2024-05-10T03:24:56.518Z - [REQUEST]:
[NX Daemon Server] - 2024-05-10T03:24:56.524Z - Time taken for 'Load Nx Plugin: /Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/plugins/project-json/build-nodes/package-json-next-to-project-json' 0.37912499997764826ms
[NX Daemon Server] - 2024-05-10T03:25:08.468Z - Established a connection. Number of open connections: 2
[NX Daemon Server] - 2024-05-10T03:25:08.469Z - Closed a connection. Number of open connections: 1
[NX Daemon Server] - 2024-05-10T03:25:08.469Z - Established a connection. Number of open connections: 2
[NX Daemon Server] - 2024-05-10T03:25:08.470Z - [REQUEST]: Client Request for Project Graph Received
[NX Daemon Server] - 2024-05-10T03:25:08.471Z - [REQUEST]: Responding to the client. project-graph
[NX Daemon Server] - 2024-05-10T03:25:08.471Z - Time taken for 'total for creating and serializing project graph' 0.6487080007791519ms
[NX Daemon Server] - 2024-05-10T03:25:08.473Z - Done responding to the client project-graph
[NX Daemon Server] - 2024-05-10T03:25:08.473Z - Handled REQUEST_PROJECT_GRAPH. Handling time: 1. Response time: 2.
[NX Daemon Server] - 2024-05-10T03:25:08.487Z - [REQUEST]: Client Request for Project Graph Received
[NX Daemon Server] - 2024-05-10T03:25:08.488Z - [REQUEST]: Responding to the client. project-graph
[NX Daemon Server] - 2024-05-10T03:25:08.488Z - Time taken for 'total for creating and serializing project graph' 0.419666999951005ms
[NX Daemon Server] - 2024-05-10T03:25:08.490Z - Done responding to the client project-graph
[NX Daemon Server] - 2024-05-10T03:25:08.490Z - Handled REQUEST_PROJECT_GRAPH. Handling time: 1. Response time: 2.
[NX Daemon Server] - 2024-05-10T03:25:08.505Z - [REQUEST]: Client Request for Project Graph Received
[NX Daemon Server] - 2024-05-10T03:25:08.506Z - [REQUEST]: Responding to the client. project-graph
[NX Daemon Server] - 2024-05-10T03:25:08.506Z - Time taken for 'total for creating and serializing project graph' 0.4012080002576113ms
[NX Daemon Server] - 2024-05-10T03:25:08.506Z - Done responding to the client project-graph
[NX Daemon Server] - 2024-05-10T03:25:08.506Z - Handled REQUEST_PROJECT_GRAPH. Handling time: 1. Response time: 0.
[NX Daemon Server] - 2024-05-10T03:25:08.519Z - [REQUEST]: Client Request for Project Graph Received
[NX Daemon Server] - 2024-05-10T03:25:08.520Z - [REQUEST]: Responding to the client. project-graph
[NX Daemon Server] - 2024-05-10T03:25:08.520Z - Time taken for 'total for creating and serializing project graph' 0.47870799992233515ms
[NX Daemon Server] - 2024-05-10T03:25:08.521Z - Done responding to the client project-graph
[NX Daemon Server] - 2024-05-10T03:25:08.521Z - Handled REQUEST_PROJECT_GRAPH. Handling time: 1. Response time: 1.
[NX Daemon Server] - 2024-05-10T03:25:08.823Z - [WATCHER]: 30 file(s) created or restored, 3 file(s) modified, 0 file(s) deleted
[NX Daemon Server] - 2024-05-10T03:25:08.823Z - [WATCHER]: Processing file changes in outputs
Plugin listed in `nx.json` not found: @nx/webpack/plugin
/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/project-graph/plugins/loader.js:207
        throw new error_types_1.LoadPluginError(moduleName, e);
              ^

LoadPluginError: Could not load plugin @nx/webpack/plugin
    at loadNxPluginAsync (/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/project-graph/plugins/loader.js:207:15)
    at async Promise.all (index 1)
    ... 2 lines matching cause stack trace ...
    at async Timeout._onTimeout (/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/daemon/server/project-graph-incremental-recomputation.js:84:63) {
  plugin: '@nx/webpack/plugin',
  [cause]: Error: Cannot find module '@nx/webpack/plugin'
  Require stack:
  - /Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/project-graph/plugins/loader.js
  - /Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/project-graph/plugins/internal-api.js
  - /Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js
  - /Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/project-graph/file-utils.js
  - /Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/utils/package-manager.js
  - /Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/devkit-internals.js
  - /Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/utils/assert-workspace-validity.js
  - /Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/project-graph/build-project-graph.js
  - /Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/project-graph/project-graph.js
  - /Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/utils/project-graph-utils.js
  - /Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/daemon/server/file-watching/file-watcher-sockets.js
  - /Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/daemon/server/server.js
  - /Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/daemon/server/start.js
      at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15)
      at Function.resolve (node:internal/modules/helpers:188:19)
      at getPluginPathAndName (/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/project-graph/plugins/loader.js:141:30)
      at loadNxPluginAsync (/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/project-graph/plugins/loader.js:199:42)
      at async Promise.all (index 1)
      at async loadNxPlugins (/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/project-graph/plugins/internal-api.js:54:9)
      at async getPlugins (/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/daemon/server/plugins.js:14:33)
      at async Timeout._onTimeout (/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/daemon/server/project-graph-incremental-recomputation.js:84:63) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
      '/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/project-graph/plugins/loader.js',
      '/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/project-graph/plugins/internal-api.js',
      '/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js',
      '/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/project-graph/file-utils.js',
      '/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/utils/package-manager.js',
      '/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/devkit-internals.js',
      '/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/utils/assert-workspace-validity.js',
      '/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/project-graph/build-project-graph.js',
      '/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/project-graph/project-graph.js',
      '/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/utils/project-graph-utils.js',
      '/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/daemon/server/file-watching/file-watcher-sockets.js',
      '/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/daemon/server/server.js',
      '/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2/node_modules/nx/src/daemon/server/start.js'
    ]
  }
}

Node.js v18.19.1
[NX Daemon Server] - 2024-05-10T03:25:39.019Z - Started listening on: /var/folders/8x/wc_x_1ks3mz6b2nl44m1_jlm0000gn/T/a0f62d6f84d85a775608/d.sock
[NX Daemon Server] - 2024-05-10T03:25:39.020Z - [WATCHER]: Subscribed to changes within: /Users/liujunzheng/webserver/localhost/nx/latest-demo (native)
[NX Daemon Server] - 2024-05-10T03:25:39.026Z - Established a connection. Number of open connections: 1
[NX Daemon Server] - 2024-05-10T03:25:39.026Z - Established a connection. Number of open connections: 2
[NX Daemon Server] - 2024-05-10T03:25:39.027Z - Closed a connection. Number of open connections: 1
[NX Daemon Server] - 2024-05-10T03:25:39.027Z - [REQUEST]: Client Request for Project Graph Received
[NX Daemon Server] - 2024-05-10T03:25:39.086Z - [REQUEST]: Updated workspace context based on watched changes, recomputing project graph...
[NX Daemon Server] - 2024-05-10T03:25:39.086Z - [REQUEST]:
[NX Daemon Server] - 2024-05-10T03:25:39.086Z - [REQUEST]:
[NX Daemon Server] - 2024-05-10T03:25:39.689Z - [REQUEST]: Responding to the client. project-graph
[NX Daemon Server] - 2024-05-10T03:25:39.690Z - Time taken for 'total for creating and serializing project graph' 662.0957080004737ms
[NX Daemon Server] - 2024-05-10T03:25:39.691Z - [WATCHER]: .nx/cache/d/server-process.json was modified
[NX Daemon Server] - 2024-05-10T03:25:39.692Z - Done responding to the client project-graph
[NX Daemon Server] - 2024-05-10T03:25:39.692Z - Handled REQUEST_PROJECT_GRAPH. Handling time: 662. Response time: 3.
[NX Daemon Server] - 2024-05-10T03:25:39.703Z - [REQUEST]: Updated workspace context based on watched changes, recomputing project graph...
[NX Daemon Server] - 2024-05-10T03:25:39.703Z - [REQUEST]: .nx/cache/d/server-process.json
[NX Daemon Server] - 2024-05-10T03:25:39.703Z - [REQUEST]:
[NX Daemon Server] - 2024-05-10T03:25:39.732Z - [REQUEST]: Responding to the client. handleHashTasks
[NX Daemon Server] - 2024-05-10T03:25:39.732Z - Done responding to the client handleHashTasks
[NX Daemon Server] - 2024-05-10T03:25:39.732Z - Handled HASH_TASKS. Handling time: 30. Response time: 0.
[NX Daemon Server] - 2024-05-10T03:25:39.732Z - Time taken for 'Load Nx Plugin: /Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2_@swc-node+register@1.8.0_@swc+core@1.3.107_@swc+helpers@0.5.11__@swc+types@0.1.6_ty_akwflzn6eisiini2gpvym3umda/node_modules/nx/src/plugins/project-json/build-nodes/package-json-next-to-project-json' 0.43337500002235174ms
[NX Daemon Server] - 2024-05-10T03:25:39.882Z - Established a connection. Number of open connections: 2
[NX Daemon Server] - 2024-05-10T03:25:39.884Z - Closed a connection. Number of open connections: 1
[NX Daemon Server] - 2024-05-10T03:25:39.884Z - Established a connection. Number of open connections: 2
[NX Daemon Server] - 2024-05-10T03:25:39.885Z - [REQUEST]: Client Request for Project Graph Received
[NX Daemon Server] - 2024-05-10T03:25:39.886Z - [REQUEST]: Responding to the client. project-graph
[NX Daemon Server] - 2024-05-10T03:25:39.886Z - Time taken for 'total for creating and serializing project graph' 0.6115420004352927ms
[NX Daemon Server] - 2024-05-10T03:25:39.887Z - Done responding to the client project-graph
[NX Daemon Server] - 2024-05-10T03:25:39.887Z - Handled REQUEST_PROJECT_GRAPH. Handling time: 1. Response time: 1.
[NX Daemon Server] - 2024-05-10T03:25:39.888Z - Established a connection. Number of open connections: 3
[NX Daemon Server] - 2024-05-10T03:25:40.014Z - Established a connection. Number of open connections: 4
[NX Daemon Server] - 2024-05-10T03:25:40.015Z - Closed a connection. Number of open connections: 3
[NX Daemon Server] - 2024-05-10T03:25:40.016Z - Established a connection. Number of open connections: 4
[NX Daemon Server] - 2024-05-10T03:25:40.016Z - [REQUEST]: Client Request for Project Graph Received
[NX Daemon Server] - 2024-05-10T03:25:40.017Z - [REQUEST]: Responding to the client. project-graph
[NX Daemon Server] - 2024-05-10T03:25:40.017Z - Time taken for 'total for creating and serializing project graph' 0.612457999959588ms
[NX Daemon Server] - 2024-05-10T03:25:40.019Z - Done responding to the client project-graph
[NX Daemon Server] - 2024-05-10T03:25:40.019Z - Handled REQUEST_PROJECT_GRAPH. Handling time: 1. Response time: 2.
/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2_@swc-node+register@1.8.0_@swc+core@1.3.107_@swc+helpers@0.5.11__@swc+types@0.1.6_ty_akwflzn6eisiini2gpvym3umda/node_modules/nx/src/hasher/native-task-hasher-impl.js:32
        const plans = this.planner.getPlansReference(tasks.map((t) => t.id), taskGraph);
                                   ^

Error: The externalDependency 'webpack-cli' for 'nest-demo:build' could not be found
    at NativeTaskHasherImpl.hashTasks (/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2_@swc-node+register@1.8.0_@swc+core@1.3.107_@swc+helpers@0.5.11__@swc+types@0.1.6_ty_akwflzn6eisiini2gpvym3umda/node_modules/nx/src/hasher/native-task-hasher-impl.js:32:36)
    at InProcessTaskHasher.hashTasks (/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2_@swc-node+register@1.8.0_@swc+core@1.3.107_@swc+helpers@0.5.11__@swc+types@0.1.6_ty_akwflzn6eisiini2gpvym3umda/node_modules/nx/src/hasher/task-hasher.js:53:50)
    at handleHashTasks (/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2_@swc-node+register@1.8.0_@swc+core@1.3.107_@swc+helpers@0.5.11__@swc+types@0.1.6_ty_akwflzn6eisiini2gpvym3umda/node_modules/nx/src/daemon/server/handle-hash-tasks.js:30:56)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async handleResult (/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2_@swc-node+register@1.8.0_@swc+core@1.3.107_@swc+helpers@0.5.11__@swc+types@0.1.6_ty_akwflzn6eisiini2gpvym3umda/node_modules/nx/src/daemon/server/server.js:107:16)
    at async handleMessage (/Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2_@swc-node+register@1.8.0_@swc+core@1.3.107_@swc+helpers@0.5.11__@swc+types@0.1.6_ty_akwflzn6eisiini2gpvym3umda/node_modules/nx/src/daemon/server/server.js:81:9)
    at async /Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2_@swc-node+register@1.8.0_@swc+core@1.3.107_@swc+helpers@0.5.11__@swc+types@0.1.6_ty_akwflzn6eisiini2gpvym3umda/node_modules/nx/src/daemon/server/server.js:45:9 {
  code: 'GenericFailure'
}

Node.js v18.19.1
[NX Daemon Server] - 2024-05-10T03:25:40.136Z - Started listening on: /var/folders/8x/wc_x_1ks3mz6b2nl44m1_jlm0000gn/T/a0f62d6f84d85a775608/d.sock
[NX Daemon Server] - 2024-05-10T03:25:40.137Z - [WATCHER]: Subscribed to changes within: /Users/liujunzheng/webserver/localhost/nx/latest-demo (native)
[NX Daemon Server] - 2024-05-10T03:25:40.143Z - Established a connection. Number of open connections: 1
[NX Daemon Server] - 2024-05-10T03:25:40.144Z - Established a connection. Number of open connections: 2
[NX Daemon Server] - 2024-05-10T03:25:40.144Z - Closed a connection. Number of open connections: 1
[NX Daemon Server] - 2024-05-10T03:25:40.145Z - [REQUEST]: Responding to the client. recordOutputsHash
[NX Daemon Server] - 2024-05-10T03:25:40.145Z - Done responding to the client recordOutputsHash
[NX Daemon Server] - 2024-05-10T03:25:40.145Z - Handled RECORD_OUTPUTS_HASH. Handling time: 0. Response time: 0.
[NX Daemon Server] - 2024-05-10T03:25:40.148Z - Closed a connection. Number of open connections: 0
[NX Daemon Server] - 2024-05-10T03:25:40.199Z - [WATCHER]: .nx/cache/d/server-process.json was modified
[NX Daemon Server] - 2024-05-10T03:25:40.358Z - [REQUEST]: Updated workspace context based on watched changes, recomputing project graph...
[NX Daemon Server] - 2024-05-10T03:25:40.358Z - [REQUEST]: .nx/cache/d/server-process.json
[NX Daemon Server] - 2024-05-10T03:25:40.358Z - [REQUEST]:
[NX Daemon Server] - 2024-05-10T03:25:40.906Z - Time taken for 'Load Nx Plugin: /Users/liujunzheng/webserver/localhost/nx/latest-demo/node_modules/.pnpm/nx@19.0.2_@swc-node+register@1.8.0_@swc+core@1.3.107_@swc+helpers@0.5.11__@swc+types@0.1.6_ty_akwflzn6eisiini2gpvym3umda/node_modules/nx/src/plugins/project-json/build-nodes/package-json-next-to-project-json' 56.063000000081956ms

Failure Logs

No response

Package Manager Version

No response

Operating System

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

Additional Information

No response

@Traivok
Copy link

Traivok commented May 15, 2024

Having the same issue using pnpm on a mac

Nx Version:

  • Local: v19.0.2
  • Global: v19.0.2

Pnpm Version:

  • 9.1.1

Node Version:

  • v20.11.0

package.json:

{
    "name": "@app",
    "version": "0.0.0",
    "license": "MIT",
    "scripts": {},
    "private": true,
    "devDependencies": {
        "@angular-devkit/build-angular": "~17.3.7",
        "@angular-devkit/core": "~17.3.7",
        "@angular-devkit/schematics": "~17.3.7",
        "@angular-eslint/eslint-plugin": "~17.3.0",
        "@angular-eslint/eslint-plugin-template": "~17.3.0",
        "@angular-eslint/template-parser": "~17.3.0",
        "@angular/cli": "~17.3.7",
        "@angular/compiler-cli": "~17.3.8",
        "@angular/language-service": "~17.3.8",
        "@nestjs/schematics": "^10.0.1",
        "@nestjs/testing": "^10.0.2",
        "@nx/angular": "19.0.2",
        "@nx/devkit": "19.0.2",
        "@nx/eslint": "19.0.2",
        "@nx/eslint-plugin": "19.0.2",
        "@nx/jest": "19.0.2",
        "@nx/js": "19.0.2",
        "@nx/nest": "19.0.2",
        "@nx/node": "19.0.2",
        "@nx/playwright": "19.0.2",
        "@nx/web": "19.0.2",
        "@nx/webpack": "19.0.2",
        "@nx/workspace": "19.0.2",
        "@playwright/test": "^1.44.0",
        "@schematics/angular": "~17.3.7",
        "@swc-node/register": "~1.8.0",
        "@swc/core": "~1.5.7",
        "@swc/helpers": "~0.5.11",
        "@types/d3": "^7.4.3",
        "@types/jest": "^29.5.12",
        "@types/node": "18.16.9",
        "@typescript-eslint/eslint-plugin": "^7.8.0",
        "@typescript-eslint/parser": "^7.8.0",
        "autoprefixer": "^10.4.19",
        "eslint": "~8.57.0",
        "eslint-config-prettier": "^9.1.0",
        "eslint-plugin-playwright": "^0.15.3",
        "jest": "^29.7.0",
        "jest-environment-jsdom": "^29.7.0",
        "jest-environment-node": "^29.4.1",
        "jest-preset-angular": "~14.0.4",
        "nx": "19.0.2",
        "postcss": "^8.4.38",
        "prettier": "^2.8.8",
        "tailwindcss": "^3.4.3",
        "ts-jest": "^29.1.2",
        "ts-node": "10.9.1",
        "typescript": "~5.4.5",
        "webpack-cli": "^5.1.4"
    },
    "dependencies": {
        "@angular/animations": "~17.3.8",
        "@angular/cdk": "^17.3.8",
        "@angular/common": "~17.3.8",
        "@angular/compiler": "~17.3.8",
        "@angular/core": "~17.3.8",
        "@angular/forms": "~17.3.8",
        "@angular/material": "^17.3.8",
        "@angular/platform-browser": "~17.3.8",
        "@angular/platform-browser-dynamic": "~17.3.8",
        "@angular/router": "~17.3.8",
        "@nestjs/cli": "^10.3.2",
        "@nestjs/common": "^10.0.2",
        "@nestjs/core": "^10.0.2",
        "@nestjs/platform-express": "^10.0.2",
        "@nestjs/swagger": "^7.3.1",
        "axios": "^1.6.0",
        "class-transformer": "^0.5.1",
        "class-validator": "^0.14.1",
        "d3": "^7.9.0",
        "reflect-metadata": "^0.1.13",
        "rxjs": "~7.8.1",
        "tslib": "^2.6.2",
        "zone.js": "~0.14.5"
    }
}

@ndcunningham
Copy link
Contributor

ndcunningham commented May 16, 2024

Hey, can you create a repro I tested this and it's working correctly.

You can also try resetting the daemon using nx reset

Repro: https://github.com/ndcunningham/nest-nx19

@junxiaotan
Copy link
Author

https://github.com/junxiaotan/nx-latest-demo_bug
nx version: 19.0.3
run step:

  1. pnpm install
  2. npx nx run nest-demo:serve:development

PS:Using npx nx reset also has the same Q&A questions

@junxiaotan
Copy link
Author

My device is Mac M2

@junxiaotan
Copy link
Author

node: v18.19.1
npx: 10.2.4
pnpm: 9.0.6

@brhamill
Copy link

Running into the same issue - only when attempting to use pnpm. I can run my app: nx dev my-app, but can't lint, build, etc.
Nx 19.0.2
Works fine when using npm.
Frustrating...

@alexkunin
Copy link

I see exactly this issue in my setup, and I think I found the reason (at least in my case): adding package-lock.json to .gitignore results in The externalDependency 'vite' for 'react:build' could not be found error.

I was able to reproduce this in a fresh container with fresh nx project (no pnpm involved).

Basic installation:

% docker run -it --rm node:20 bash
root@8556091efe34:/# node --version
v20.13.1
root@8556091efe34:/# npm --version
10.5.2
root@8556091efe34:/# npx create-nx-workspace
Need to install the following packages:
create-nx-workspace@19.0.6
Ok to proceed? (y) y

 NX   Let's create a new workspace [https://nx.dev/getting-started/intro]

✔ Where would you like to create your workspace? · org
✔ Which stack do you want to use? · react
✔ What framework would you like to use? · none
✔ Integrated monorepo, or standalone project? · integrated
✔ Application name · org
✔ Which bundler would you like to use? · vite
✔ Test runner to use for end to end (E2E) tests · playwright
✔ Default stylesheet format · scss
✔ Set up CI with caching, distribution and test deflaking · skip
✔ Would you like remote caching to make your build faster? · skip

 NX   Creating your v19.0.6 workspace.

✔ Installing dependencies with npm
✔ Successfully created the workspace: org.
Author identity unknown

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'root@8556091efe34.(none)')
128

———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————


 NX   Nx CLI is not installed globally.

This means that you will have to use "npx nx" to execute commands in the workspace.
Run "npm i -g nx" to be able to execute command directly.


———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————


 NX   First time using Nx? Check out this interactive Nx tutorial.

https://nx.dev/react-tutorial/1-code-generation

npm notice 
npm notice New minor version of npm available! 10.5.2 -> 10.8.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.0
npm notice Run npm install -g npm@10.8.0 to update!
npm notice 
root@8556091efe34:/# cd org

First build:

root@8556091efe34:/org# npx nx build org
The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.

> nx run org:build

> vite build

The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
vite v5.0.13 building for production...
✓ 32 modules transformed.
../../dist/apps/org/index.html                   0.47 kB │ gzip:   0.30 kB
../../dist/apps/org/assets/index-B_SY1GJM.css    0.00 kB │ gzip:   0.02 kB
../../dist/apps/org/assets/index-BVsD7syJ.js   366.19 kB │ gzip: 106.88 kB
✓ built in 2.80s

———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 NX   Successfully ran target build for project org (3s)

Throwing the wrench and clearing :

root@8556091efe34:/org# echo -e "\npackage-lock.json" >> .gitignore
root@8556091efe34:/org# npx nx build org
The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.

 NX   The externalDependency 'vite' for 'org:build' could not be found

Pass --verbose to see the stacktrace.

Fixing things:

root@8556091efe34:/org# sed -i '/package-lock.json/d' .gitignore
root@8556091efe34:/org# npx nx build org
The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.

> nx run org:build

> vite build

The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
vite v5.0.13 building for production...
✓ 32 modules transformed.
../../dist/apps/org/index.html                   0.47 kB │ gzip:   0.30 kB
../../dist/apps/org/assets/index-B_SY1GJM.css    0.00 kB │ gzip:   0.02 kB
../../dist/apps/org/assets/index-BVsD7syJ.js   366.19 kB │ gzip: 106.88 kB
✓ built in 2.05s

———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 NX   Successfully ran target build for project org (3s)

@brhamill
Copy link

Found the answer to my problem. I was using version 9.x of pnpm. Go back to version 8.5.1 and everything is fine. It looks like 9.x isn't quite ready for primetime.

Hope this helps others...

Copy link

This issue has been automatically marked as stale because no reproduction was provided within 7 days.
Please help us help you. Providing a repository exhibiting the issue helps us diagnose and fix the issue.
Any time that we spend reproducing this issue is time taken away from addressing this issue and other issues.
This issue will be closed in 21 days if a reproduction is not provided.
If a reproduction 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 31, 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

6 participants