Description
The Nx Daemon repeatedly crashes or disconnects with write EPIPE and Socket closed, eventually leading to the creation of the .nx/workspace-data/d/disabled file. This behavior seems to be triggered by the IntelliJ Nx Console plugin's background status checks, which appear to interfere with the active Daemon socket.
When this happens, subsequent Nx commands run without the daemon, and the only way to recover is to manually delete .nx and/or the disabled file and run npx nx reset.
Environment
- Nx Version: 22.5.4 (local, from
package.json)
- Node Version: 24.14.0
- OS: Windows 11
- IDE: IntelliJ IDEA with Nx Console plugin
- Daemon: Enabled (default settings)
nx.json (relevant part):
{
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": ["build"],
"cacheDirectory": ".nx/cache",
"parallel": 3,
"useDaemonProcess": true
}
}
}
}
Current Behavior
-
Nx Daemon starts normally and successfully builds the project graph.
-
Project graph and cache are written without errors, e.g.:
[NX v22.5.4 Daemon Server] - ... Wrote project graph cache to ...\.nx\workspace-data\project-graph.json
[NX v22.5.4 Daemon Server] - Responding to REQUEST_PROJECT_GRAPH message
[NX v22.5.4 Daemon Server] - [REQUEST]: Responding to the client. project-graph
[NX v22.5.4 Daemon Client] - [Messenger] Received message, length: 872783
-
After a short time (often ~20–30 seconds), Nx Console in IntelliJ performs a background status check:
[NX v22.5.4 Daemon Server] - [NX-CONSOLE]: Successfully pulled latest Nx to C:\Users\...\AppData\Local\Temp\tmp-XXXX
[NX v22.5.4 Daemon Server] - [NX-CONSOLE]: Using local implementation (NX_USE_LOCAL=true or inner call)
[NX v22.5.4 Daemon Server] - [NX-CONSOLE]: Console status check completed, shouldPrompt: false
-
Shortly after that, the active daemon client reports that the socket was closed and tries to reconnect:
[NX v22.5.4 Daemon Client] - [ProjectGraphListener] Socket closed, triggering reconnection
[NX v22.5.4 Daemon Client] - [ProjectGraphListener] Starting reconnection for 1 callbacks
[NX v22.5.4 Daemon Client] - [Client] Waiting for server (max: 6000 attempts, 10ms interval)
-
In other runs, this is followed by Socket error: write EPIPE messages from the client. After repeated failures, Nx creates a disabled file:
<project-root>/.nx/workspace-data/d/disabled
Once this file exists, the daemon is no longer used, even if --start is called.
Expected Behavior
- The IntelliJ Nx Console plugin should not cause the existing daemon connection to be closed or destabilized.
- Background status checks from Nx Console should not result in
Socket closed / EPIPE errors for other daemon clients.
- The daemon should remain stable while both CLI (
npx nx ...) and IntelliJ Nx Console are in use.
Steps to Reproduce
-
Open workspace in IntelliJ:
- Open an Nx workspace with
nx set to ~22.5.4 in package.json.
- Ensure the Nx Console plugin for IntelliJ IDEA is installed and enabled.
-
Clean daemon state:
-
Close all running Node processes that might hold daemon sockets (optional but helps):
stop-process -name node -force -ErrorAction SilentlyContinue
-
In the workspace root, delete .nx and reset Nx:
Remove-Item -Recurse -Force .nx
npx nx reset
-
Enable verbose logging:
-
Set environment variable:
$env:NX_VERBOSE_LOGGING = "true"
-
Run a command that uses the daemon, e.g.:
-
Confirm that daemon.log is created in:
<project-root>/.nx/workspace-data/d/daemon.log
-
Trigger Nx Console refresh:
- In IntelliJ, open the Nx Console tool window.
- Click the "Refresh" button to refresh the project graph.
-
Wait and observe logs:
-
Observe failure / disabled file:
-
In some runs, additional errors appear:
[NX v22.5.4 Daemon Client] - [Messenger] Socket error: write EPIPE
-
Check the daemon directory:
<project-root>/.nx/workspace-data/d/
-
A file named disabled will often be present after repeated failures. From that point on, the daemon is not used anymore by default. 
-
Control test (without IntelliJ):
- Close IntelliJ IDEA completely.
- Delete
.nx again and run npx nx reset.
- Run
npx nx graph and leave it running for a while.
- In this setup, the daemon remains stable and no
Socket closed / EPIPE / disabled behavior is observed.
Additional Notes
- This strongly suggests a race condition or resource conflict between the IntelliJ Nx Console plugin and other daemon clients.
- The daemon itself appears to function correctly when used solely from the CLI.
- Optionally: provide clearer logging when the daemon decides to create the
disabled file due to IDE-induced failures, so users understand the root cause more easily.
Description
The Nx Daemon repeatedly crashes or disconnects with
write EPIPEandSocket closed, eventually leading to the creation of the.nx/workspace-data/d/disabledfile. This behavior seems to be triggered by the IntelliJ Nx Console plugin's background status checks, which appear to interfere with the active Daemon socket.When this happens, subsequent Nx commands run without the daemon, and the only way to recover is to manually delete
.nxand/or thedisabledfile and runnpx nx reset.Environment
package.json)nx.json(relevant part):{ "tasksRunnerOptions": { "default": { "runner": "nx/tasks-runners/default", "options": { "cacheableOperations": ["build"], "cacheDirectory": ".nx/cache", "parallel": 3, "useDaemonProcess": true } } } }Current Behavior
Nx Daemon starts normally and successfully builds the project graph.
Project graph and cache are written without errors, e.g.:
After a short time (often ~20–30 seconds), Nx Console in IntelliJ performs a background status check:
Shortly after that, the active daemon client reports that the socket was closed and tries to reconnect:
In other runs, this is followed by
Socket error: write EPIPEmessages from the client. After repeated failures, Nx creates adisabledfile:Once this file exists, the daemon is no longer used, even if
--startis called.Expected Behavior
Socket closed/EPIPEerrors for other daemon clients.npx nx ...) and IntelliJ Nx Console are in use.Steps to Reproduce
Open workspace in IntelliJ:
nxset to~22.5.4inpackage.json.Clean daemon state:
Close all running Node processes that might hold daemon sockets (optional but helps):
In the workspace root, delete
.nxand reset Nx:Enable verbose logging:
Set environment variable:
Run a command that uses the daemon, e.g.:
Confirm that
daemon.logis created in:Trigger Nx Console refresh:
Wait and observe logs:
Wait ~20–30 seconds.
Inspect
daemon.logand look for a sequence like:Observe failure / disabled file:
In some runs, additional errors appear:
Check the daemon directory:
A file named
disabledwill often be present after repeated failures. From that point on, the daemon is not used anymore by default.Control test (without IntelliJ):
.nxagain and runnpx nx reset.npx nx graphand leave it running for a while.Socket closed/EPIPE/disabledbehavior is observed.Additional Notes
disabledfile due to IDE-induced failures, so users understand the root cause more easily.