From ac204881137fd7854da3d52c0417f0c1b7626d5d Mon Sep 17 00:00:00 2001 From: Smit Barmase Date: Wed, 1 Apr 2026 14:10:23 +0530 Subject: [PATCH] eslint: Fix ESLint server startup failure on stale cached server install (#52883) Closes https://github.com/zed-industries/zed/issues/19709#issuecomment-3494789304 Closes https://github.com/zed-industries/zed/issues/24194#issuecomment-2835787560 This PR fixes case where if eslint cached install is partial or stale, Zed can try to launch a missing `eslintServer.js` and the server crashes with `MODULE_NOT_FOUND`. ``` Error: Cannot find module '/Users/.../languages/eslint/vscode-eslint-2.4.4/vscode-eslint/server/out/eslintServer.js' ``` Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Fixed ESLint server startup failures caused by reusing an incomplete or stale cached server install. --- crates/languages/src/eslint.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/languages/src/eslint.rs b/crates/languages/src/eslint.rs index 943034652de852b2c39b4887218c3c8e28f329e1..bf51636f60bb4e0eec6eebcd3efaab2996352c18 100644 --- a/crates/languages/src/eslint.rs +++ b/crates/languages/src/eslint.rs @@ -148,6 +148,7 @@ impl LspInstaller for EsLintLspAdapter { ) -> Option { let server_path = Self::build_destination_path(&container_dir).join(EsLintLspAdapter::SERVER_PATH); + fs::metadata(&server_path).await.ok()?; Some(LanguageServerBinary { path: self.node.binary_path().await.ok()?, env: None,