I am working on a project using React with TypeScript and running my project locally using NX. However, often times, the localhost would stop working with a message popping up on my command line saying "Daemon process terminated and closed the connection". Sometimes, it terminates a few minutes after I run my program, other times, the NX daemon just closed before I could even run my webapp. It's frustrating to restart the NX daemon every time it terminates.
Before asking this question, I have looked at other similar questions online, including here in SO. I followed the suggestions in this question and did nx repair
and nx reset
but the problem persists.
I know that according to the NX docs the daemon would automatically terminates itself after a few hours of inactivity but in my case it seems that it is arbitrarily terminating itself after a few minutes.
Does anyone have an idea what is the problem here?
Here is my daemon.log
for reference (some information has been redacted):
[NX Daemon Server] - 2025-03-18T09:18:36.403Z - Started listening on: \\.\pipe\nx\C:\Users\(username)\AppData\Local\Temp\b6affa2238cea7871454\d.sock
[NX Daemon Server] - 2025-03-18T09:18:37.124Z - Established a connection
[NX Daemon Server] - 2025-03-18T09:18:37.125Z - Established a connection
[NX Daemon Server] - 2025-03-18T09:18:37.125Z - Established a connection
[NX Daemon Server] - 2025-03-18T09:18:37.125Z - Closed a connection
[NX Daemon Server] - 2025-03-18T09:18:37.126Z - Closed a connection
[NX Daemon Server] - 2025-03-18T09:18:37.126Z - [WATCHER]: Subscribed to changes within: (repo directory)
[NX Daemon Server] - 2025-03-18T09:18:37.131Z - [REQUEST]: Client Request for Project Graph Received
[NX Daemon Server] - 2025-03-18T09:18:37.147Z - [REQUEST]: Updated file-hasher based on watched changes, recomputing project graph...
[NX Daemon Server] - 2025-03-18T09:18:37.214Z - Time taken for 'hash changed files from watcher' 0.15810000000010405ms
[NX Daemon Server] - 2025-03-18T09:18:42.869Z - [REQUEST]: Responding to the client. project-graph
[NX Daemon Server] - 2025-03-18T09:18:42.872Z - Time taken for 'total for creating and serializing project graph' 5738.3685ms
[NX Daemon Server] - 2025-03-18T09:18:42.873Z - Done responding to the client project-graph
[NX Daemon Server] - 2025-03-18T12:01:31.227Z - Closed a connection
[NX Daemon Server] - 2025-03-19T02:47:10.934Z - Started listening on: \\.\pipe\nx\C:\Users\(username)\AppData\Local\Temp\b6affa2238cea7871454\d.sock
[NX Daemon Server] - 2025-03-19T02:47:12.419Z - [WATCHER]: Subscribed to changes within: (repo directory)