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

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

Open
1 of 4 tasks
daniellockyer opened this issue Sep 16, 2024 · 4 comments
Open
1 of 4 tasks

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

daniellockyer opened this issue Sep 16, 2024 · 4 comments
Assignees
Labels
scope: core core nx functionality type: bug

Comments

@daniellockyer
Copy link

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

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

Additional Information

No response

@JamesHenry JamesHenry self-assigned this Sep 18, 2024
@JamesHenry
Copy link
Collaborator

JamesHenry commented Sep 18, 2024

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

@jaysoo jaysoo added the scope: core core nx functionality label Sep 25, 2024
@alex-page
Copy link

alex-page commented Oct 15, 2024

@JamesHenry @jaysoo any news on this? I am getting multiple issues with nx watch and concurrently 👀

pnpm dev:watch 

> nx watch --projects=@shopify/admin-ui-components --includeDependentProjects -- nx build '$NX_PROJECT_NAME'

 NX   Watch error

An error occurred during the watch process:
connect ENOENT /var/folders/bp/975tvzxj7snc1wxkhsml1gqm0000gn/T/efd3fe37a4a86612a288/d.sock

node_modules/.pnpm/[email protected]/node_modules/nx/src/command-line/watch/watch.js:161
            batchQueue.enqueue(data.changedProjects, data.changedFiles);
                                    ^

TypeError: Cannot read properties of null (reading 'changedProjects')
    at node_modules/.pnpm/[email protected]/node_modules/nx/src/command-line/watch/watch.js:161:37
    at Socket.<anonymous> (/Users/alex/src/github.com/Shopify/admin-ui-foundations/node_modules/.pnpm/[email protected]/node_modules/nx/src/daemon/client/client.js:156:25)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
pnpm dev

 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/alex/src/github.com/Shopify/admin-ui-foundations/.nx/workspace-data/d/daemon.log

 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.

The logs have:

[NX Daemon Server] - 2024-10-15T03:54:31.895Z - Started listening on: /var/folders/bp/975tvzxj7snc1wxkhsml1gqm0000gn/T/efd3fe37a4a86612a288/d.sock
[NX Daemon Server] - 2024-10-15T03:54:31.897Z - [WATCHER]: Subscribed to changes within: /Users/alex/src/github.com/Shopify/admin-ui-foundations (native)
[NX Daemon Server] - 2024-10-15T03:54:31.901Z - Established a connection. Number of open connections: 1
[NX Daemon Server] - 2024-10-15T03:54:31.901Z - Established a connection. Number of open connections: 2
[NX Daemon Server] - 2024-10-15T03:54:31.902Z - Closed a connection. Number of open connections: 1
[NX Daemon Server] - 2024-10-15T03:54:31.902Z - [REQUEST]: Client Request for Project Graph Received
[NX Daemon Server] - 2024-10-15T03:54:31.936Z - [REQUEST]: Updated workspace context based on watched changes, recomputing project graph...
[NX Daemon Server] - 2024-10-15T03:54:31.936Z - [REQUEST]: 
[NX Daemon Server] - 2024-10-15T03:54:31.936Z - [REQUEST]: 
[NX Daemon Server] - 2024-10-15T03:54:31.939Z - Started listening on: /var/folders/bp/975tvzxj7snc1wxkhsml1gqm0000gn/T/efd3fe37a4a86612a288/d.sock
[NX Daemon Server] - 2024-10-15T03:54:31.941Z - [WATCHER]: Subscribed to changes within: 
[NX Daemon Server] - 2024-10-15T03:54:32.117Z - [REQUEST]: Responding to the client. project-graph
[NX Daemon Server] - 2024-10-15T03:54:32.117Z - Time taken for 'total for creating and serializing project graph' 214.37520800000001ms
[NX Daemon Server] - 2024-10-15T03:54:32.117Z - Established a connection. Number of open connections: 2
[NX Daemon Server] - 2024-10-15T03:54:32.118Z - [WATCHER]: .nx/workspace-data/d/server-process.json was created or restored
[NX Daemon Server] - 2024-10-15T03:54:32.118Z - [WATCHER]: Stopping the watcher for 
[NX Daemon Server] - 2024-10-15T03:54:32.118Z - Closed a connection. Number of open connections: 1
[NX Daemon Server] - 2024-10-15T03:54:32.118Z - [WATCHER]: Stopping the watcher for
[NX Daemon Server] - 2024-10-15T03:54:32.118Z - Server stopped because: "this process is no longer the current daemon (native)"

@JamesHenry
Copy link
Collaborator

@alex-page We were able to come up with a dedicated workaround for the original report because their repo is open source. Is yours?

@alex-page
Copy link

No. It is a closed source repository. Sorry. Would you be able to link to the PR or fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: core core nx functionality type: bug
Projects
None yet
Development

No branches or pull requests

4 participants