Skip to content

Commit fbd6d42

Browse files
committed
fix(core): remove error responses for lockfile and version changes
When lockfiles or Nx versions change, just restart the daemon without sending error responses to clients. The reconnection logic handles this transparently, providing a better user experience.
1 parent f60bf1f commit fbd6d42

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

packages/nx/src/daemon/server/server.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -212,27 +212,17 @@ async function handleMessage(socket: Socket, data: string) {
212212
const outdated = daemonIsOutdated();
213213
if (outdated) {
214214
if (outdated === 'LOCK_FILES_CHANGED') {
215-
// For lock file changes, start a new daemon before exiting
216-
await respondToClient(
217-
socket,
218-
serializeResult(new Error(outdated), null, null),
219-
null
220-
);
215+
// For lock file changes, restart daemon - clients will reconnect automatically
221216
await handleServerProcessTerminationWithRestart({
222217
server,
223218
reason: outdated,
224219
sockets: openSockets,
225220
});
226221
} else if (outdated === 'NX_VERSION_CHANGED') {
227-
// For version changes, start a new daemon before exiting
222+
// For version changes, restart daemon - clients will reconnect automatically
228223
serverLogger.log(
229224
'Nx version changed, starting new daemon and shutting down'
230225
);
231-
await respondToClient(
232-
socket,
233-
serializeResult(new Error(outdated), null, null),
234-
null
235-
);
236226
await handleServerProcessTerminationWithRestart({
237227
server,
238228
reason: outdated,

0 commit comments

Comments
 (0)