nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.39k stars 2.33k forks source link

Cannot read properties of null (reading 'changedProjects') #27925

Open daniellockyer opened 2 weeks ago

daniellockyer commented 2 weeks ago

Current Behavior

When upgrading from Nx v16 to 19, we experience a crash w/ errors.

Expected Behavior

I do not expect Nx to crash.

GitHub Repo

https://github.com/tryghost/ghost

Steps to Reproduce

  1. Clone our OSS repo: https://github.com/tryghost/ghost
  2. Update Nx to the latest version: https://github.com/TryGhost/Ghost/blob/430fbdb987c7ac181f9ae7360c4b94d745a0f35b/package.json#L121 (and run yarn)
  3. Re-enable the daemon process: https://github.com/TryGhost/Ghost/blob/430fbdb987c7ac181f9ae7360c4b94d745a0f35b/nx.json#L13 (we had to disable it due to a different bug)
  4. Run yarn dev
  5. Observe crash 💥

Nx Report

$ yarn nx report
yarn run v1.22.22
$ /Users/neo/code/work/Ghost/node_modules/.bin/nx report

 NX   Report complete - copy this into the issue template

Node           : 20.17.0
OS             : darwin-arm64
Native Target  : aarch64-macos
yarn           : 1.22.22

nx          : 19.7.3
@nrwl/tao   : 19.7.3
typescript  : 5.4.5

✨  Done in 0.72s.

Failure Logs

[ts]
[ts]  NX   Watch error
[ts]
[ts] An error occurred during the watch process:
[ts] connect ENOENT /var/folders/53/2w60w5l94sb6r3gg7ydw6tl40000gn/T/459dadd7eae55fdccfe3/d.sock
[ts]
[t
[ts]             batchQueue.enqueue(data.changedProjects, data.changedFiles);
[ts]                                     ^
[ts]
[ts] TypeError: Cannot read properties of null (reading 'changedProjects')
[ts]     at /Users/neo/code/work/Ghost/node_modules/nx/src/command-line/watch/watch.js:165:37
[ts]     at Socket.<anonymous> (/Users/neo/code/work/Ghost/node_modules/nx/src/daemon/client/client.js:173:25)
[t
[ts]     at emitErrorNT (node:internal/streams/destroy:169:8)
[ts]     at emitErrorCloseNT (node:internal/streams/destroy:128:3)
[ts]     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
[ts]
[ts] Node.js v20.17.0
[ts] while [ 1 ]; do nx watch --projects=ghost/bookshelf-repository,ghost/collections,ghost/donations,ghost/email-addresses,ghost/ghost,ghost/in-memory-repository,ghost/mail-events,ghost/model-to-domain-event-interceptor,ghost/nql-filter-expansions,ghost/post-events,ghost/post-revisions,ghost/recommendations -- nx run \$NX_PROJECT_NAME:build:ts; done exited with code SIGTE
RM

Package Manager Version

1.22.22

Operating System

Additional Information

No response

JamesHenry commented 2 weeks ago

We're collaborating on this one, it's specifically the involvement of concurrently delegating to a bunch of different nx watch processes at once (with the daemon involved), I'll leave open for now