zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
50.14k stars 3.08k forks source link

[WINDOWS] Most LSPs give error: "Cannot read LSP message header" #12013

Open Z3NTL3 opened 6 months ago

Z3NTL3 commented 6 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Don't know, I just did compile to Windows and all suddenly most LSPs gave this error.

Environment

~ via  v20.11.0
❯ Get-ComputerInfo

WindowsBuildLabEx                                       : 22621.1.amd64fre.ni_release.220506-1250
WindowsCurrentVersion                                   : 6.3
WindowsEditionId                                        : Core
WindowsInstallationType                                 : Client
WindowsInstallDateFromRegistry                          : 24/01/2024 11:10:49
WindowsProductId                                        : 00325-96698-25104-AAOEM
WindowsProductName                                      : Windows 10 Home
WindowsRegisteredOrganization                           :
WindowsRegisteredOwner                                  : efdal.pix4@outlook.com
WindowsSystemRoot                                       : C:\WINDOWS
WindowsVersion                                          : 2009
OSDisplayVersion                                        : 23H2
BiosCharacteristics                                     : {7, 11, 12, 15...}
BiosBIOSVersion                                         : {_ASUS_ - 1072009, FA506IV.320, American Megatrends - 50010}
BiosBuildNumber                                         :
BiosCaption                                             : FA506IV.320
BiosCodeSet                                             :
BiosCurrentLanguage                                     : en|US|iso8859-1
BiosDescription                                         : FA506IV.320
BiosEmbeddedControllerMajorVersion                      : 3
BiosEmbeddedControllerMinorVersion                      : 15
BiosFirmwareType                                        : Uefi
BiosIdentificationCode                                  :
BiosInstallableLanguages                                : 1
BiosInstallDate                                         :
BiosLanguageEdition                                     :
BiosListOfLanguages                                     : {en|US|iso8859-1}
BiosManufacturer                                        : American Megatrends Inc.
BiosName                                                : FA506IV.320
BiosOtherTargetOS                                       :
BiosPrimaryBIOS                                         : True
BiosReleaseDate                                         : 01/06/2022 02:00:00
BiosSeralNumber                                         : L8NRCX01B611329
BiosSMBIOSBIOSVersion                                   : FA506IV.320
BiosSMBIOSMajorVersion                                  : 3
BiosSMBIOSMinorVersion                                  : 2
BiosSMBIOSPresent                                       : True
BiosSoftwareElementState                                : Running
BiosStatus                                              : OK
BiosSystemBiosMajorVersion                              : 5
BiosSystemBiosMinorVersion                              : 16
BiosTargetOperatingSystem                               : 0
BiosVersion                                             : _ASUS_ - 1072009
CsAdminPasswordStatus                                   : Unknown
CsAutomaticManagedPagefile                              : True
CsAutomaticResetBootOption                              : True
CsAutomaticResetCapability                              : True
CsBootOptionOnLimit                                     :
CsBootOptionOnWatchDog                                  :
CsBootROMSupported                                      : True
CsBootStatus                                            : {0, 0, 0, 0...}
CsBootupState                                           : Normal boot
CsCaption                                               : DESKTOP-0D8QCTN
CsChassisBootupState                                    : Safe
CsChassisSKUNumber                                      : Default string
CsCurrentTimeZone                                       : 120
CsDaylightInEffect                                      : True
CsDescription                                           : AT/AT COMPATIBLE
CsDNSHostName                                           : DESKTOP-0D8QCTN
CsDomain                                                : WORKGROUP
CsDomainRole                                            : StandaloneWorkstation
CsEnableDaylightSavingsTime                             : True
CsFrontPanelResetStatus                                 : Unknown
CsHypervisorPresent                                     : False
CsInfraredSupported                                     : False
CsInitialLoadInfo                                       :
CsInstallDate                                           :
CsKeyboardPasswordStatus                                : Unknown
CsLastLoadInfo                                          :
CsManufacturer                                          : ASUSTeK COMPUTER INC.
CsModel                                                 : ASUS TUF Gaming A15 FA506IV_FX506IV
CsName                                                  : DESKTOP-0D8QCTN
CsNetworkAdapters                                       : {WiFi, Bluetooth Network Connection, Ethernet}
CsNetworkServerModeEnabled                              : True
CsNumberOfLogicalProcessors                             : 16
CsNumberOfProcessors                                    : 1
CsProcessors                                            : {AMD Ryzen 7 4800H with Radeon Graphics         }
CsOEMStringArray                                        : {  ,  ,  ,  ...}
CsPartOfDomain                                          : False
CsPauseAfterReset                                       : -1
CsPCSystemType                                          : Mobile
CsPCSystemTypeEx                                        : Mobile
CsPowerManagementCapabilities                           :
CsPowerManagementSupported                              :
CsPowerOnPasswordStatus                                 : Unknown
CsPowerState                                            : Unknown
CsPowerSupplyState                                      : Safe
CsPrimaryOwnerContact                                   :
CsResetCapability                                       : Other
CsResetCount                                            : -1
CsResetLimit                                            : -1
CsRoles                                                 : {LM_Workstation, LM_Server, NT}
CsStatus                                                : OK
CsSupportContactDescription                             :
CsSystemFamily                                          : ASUS TUF Gaming A15
CsSystemSKUNumber                                       :
CsSystemType                                            : x64-based PC
CsThermalState                                          : Safe
CsTotalPhysicalMemory                                   : 16556679168
CsPhyicallyInstalledMemory                              : 16777216
CsUserName                                              : DESKTOP-0D8QCTN\efdal
CsWakeUpType                                            : PowerSwitch
CsWorkgroup                                             : WORKGROUP
OsName                                                  : Microsoft Windows 11 Home
OsType                                                  : WINNT
OsOperatingSystemSKU                                    : WindowsHome
OsVersion                                               : 10.0.22631
OsCSDVersion                                            :
OsBuildNumber                                           : 22631
OsHotFixes                                              : {KB5037591, KB5027397, KB5037771, KB5037020...}
OsBootDevice                                            : \Device\HarddiskVolume1
OsSystemDevice                                          : \Device\HarddiskVolume3
OsSystemDirectory                                       : C:\WINDOWS\system32
OsSystemDrive                                           : C:
OsWindowsDirectory                                      : C:\WINDOWS
OsCountryCode                                           : 44
OsCurrentTimeZone                                       : 120
OsLocaleID                                              : 0809
OsLocale                                                : en-GB
OsLocalDateTime                                         : 18/05/2024 09:25:43
OsLastBootUpTime                                        : 17/05/2024 13:26:54
OsUptime                                                : 19:58:48.1187349
OsBuildType                                             : Multiprocessor Free
OsCodeSet                                               : 1252
OsDataExecutionPreventionAvailable                      : True
OsDataExecutionPrevention32BitApplications              : True
OsDataExecutionPreventionDrivers                        : True
OsDataExecutionPreventionSupportPolicy                  : OptIn
OsDebug                                                 : False
OsDistributed                                           : False
OsEncryptionLevel                                       : 256
OsForegroundApplicationBoost                            : Maximum
OsTotalVisibleMemorySize                                : 16168632
OsFreePhysicalMemory                                    : 6381824
OsTotalVirtualMemorySize                                : 21673656
OsFreeVirtualMemory                                     : 8281472
OsInUseVirtualMemory                                    : 13392184
OsTotalSwapSpaceSize                                    :
OsSizeStoredInPagingFiles                               : 5505024
OsFreeSpaceInPagingFiles                                : 5351476
OsPagingFiles                                           : {C:\pagefile.sys}
OsHardwareAbstractionLayer                              : 10.0.22621.2506
OsInstallDate                                           : 24/01/2024 12:10:49
OsManufacturer                                          : Microsoft Corporation
OsMaxNumberOfProcesses                                  : 4294967295
OsMaxProcessMemorySize                                  : 137438953344
OsMuiLanguages                                          : {en-GB, en-US, nl-NL}
OsNumberOfLicensedUsers                                 :
OsNumberOfProcesses                                     : 269
OsNumberOfUsers                                         : 2
OsOrganization                                          :
OsArchitecture                                          : 64-bit
OsLanguage                                              : en-GB
OsProductSuites                                         : {TerminalServicesSingleSession, HomeEdition}
OsOtherTypeDescription                                  :
OsPAEEnabled                                            :
OsPortableOperatingSystem                               : False
OsPrimary                                               : True
OsProductType                                           : WorkStation
OsServicePackMajorVersion                               : 0
OsServicePackMinorVersion                               : 0
OsStatus                                                : OK
OsSuites                                                : {TerminalServices, TerminalServicesSingleSession,
                                                          HomeEdition}
OsServerLevel                                           :
KeyboardLayout                                          : 00020409
TimeZone                                                : (UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna
LogonServer                                             : \\DESKTOP-0D8QCTN
PowerPlatformRole                                       : Mobile
HyperVisorPresent                                       : False
HyperVRequirementDataExecutionPreventionAvailable       : True
HyperVRequirementSecondLevelAddressTranslation          : True
HyperVRequirementVirtualizationFirmwareEnabled          : True
HyperVRequirementVMMonitorModeExtensions                : True
DeviceGuardSmartStatus                                  : Off
DeviceGuardRequiredSecurityProperties                   :
DeviceGuardAvailableSecurityProperties                  :
DeviceGuardSecurityServicesConfigured                   :
DeviceGuardSecurityServicesRunning                      :
DeviceGuardCodeIntegrityPolicyEnforcementStatus         : EnforcementMode
DeviceGuardUserModeCodeIntegrityPolicyEnforcementStatus : Off

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

// LOGS
[2024-05-18T09:19:47+02:00 ERROR util] crates\lsp\src/lsp.rs:357: cannot read LSP message headers
[2024-05-18T09:19:47+02:00 ERROR project] failed to start language server "intelephense": oneshot canceled
[2024-05-18T09:19:47+02:00 ERROR project] server stderr: Some("node:internal/modules/cjs/loader:1078\r\n  throw err;\r\n  ^\r\n\r\nError: Cannot find module 'C:\\C:\\Users\\efdal\\AppData\\Local\\Zed\\extensions\\work\\php\\node_modules\\intelephense\\lib\\intelephense.js'\r\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)\r\n    at Module._load (node:internal/modules/cjs/loader:920:27)\r\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\r\n    at node:internal/main/run_main_module:23:47 {\r\n  code: 'MODULE_NOT_FOUND',\r\n  requireStack: []\r\n}\r\n\r\nNode.js v18.15.0\r\n")
[2024-05-18T09:19:47+02:00 ERROR util] crates\lsp\src/lsp.rs:773: server shut down
[2024-05-18T09:19:48+02:00 ERROR util] crates\lsp\src/lsp.rs:357: cannot read LSP message headers
[2024-05-18T09:19:48+02:00 ERROR project] failed to start language server "vscode-html-language-server": oneshot canceled
[2024-05-18T09:19:48+02:00 ERROR project] server stderr: Some("node:internal/modules/cjs/loader:1078\r\n  throw err;\r\n  ^\r\n\r\nError: Cannot find module 'C:\\C:\\Users\\efdal\\AppData\\Local\\Zed\\extensions\\work\\html\\node_modules\\vscode-langservers-extracted\\bin\\vscode-html-language-server'\r\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)\r\n    at Module._load (node:internal/modules/cjs/loader:920:27)\r\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\r\n    at node:internal/main/run_main_module:23:47 {\r\n  code: 'MODULE_NOT_FOUND',\r\n  requireStack: []\r\n}\r\n\r\nNode.js v18.15.0\r\n")
[2024-05-18T09:19:48+02:00 ERROR util] crates\lsp\src/lsp.rs:773: server shut down
[2024-05-18T09:19:48+02:00 ERROR util] crates\language\src\language_registry.rs:877: server container removal

Caused by:
    The system cannot find the file specified. (os error 2)
[2024-05-18T09:19:49+02:00 ERROR util] crates\language\src\language_registry.rs:877: server container removal

Caused by:
    The system cannot find the file specified. (os error 2)
[2024-05-18T09:19:50+02:00 ERROR util] crates\lsp\src/lsp.rs:357: cannot read LSP message headers
[2024-05-18T09:19:50+02:00 ERROR project] failed to start language server "eslint": oneshot canceled
[2024-05-18T09:19:50+02:00 ERROR project] server stderr: Some("node:internal/modules/cjs/loader:1078\r\n  throw err;\r\n  ^\r\n\r\nError: Cannot find module 'C:\\Users\\efdal\\AppData\\Local\\Zed\\languages\\eslint\\vscode-eslint-release\\vscode-eslint\\server\\out\\eslintServer.js'\r\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)\r\n    at Module._load (node:internal/modules/cjs/loader:920:27)\r\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\r\n    at node:internal/main/run_main_module:23:47 {\r\n  code: 'MODULE_NOT_FOUND',\r\n  requireStack: []\r\n}\r\n\r\nNode.js v18.15.0\r\n")
[2024-05-18T09:19:50+02:00 ERROR util] crates\lsp\src/lsp.rs:773: server shut down
[2024-05-18T09:19:54+02:00 ERROR util] crates\lsp\src/lsp.rs:357: cannot read LSP message headers
[2024-05-18T09:19:54+02:00 ERROR project] failed to start language server "tailwindcss-language-server": oneshot canceled
[2024-05-18T09:19:54+02:00 ERROR project] server stderr: Some("C:\\Users\\efdal\\AppData\\Local\\Zed\\languages\\tailwindcss-language-server\\node_modules\\.bin\\tailwindcss-language-server:2\r\nbasedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")\r\n          ^^^^^^^\r\n\r\nSyntaxError: missing ) after argument list\r\n    at internalCompileFunction (node:internal/vm:73:18)\r\n    at wrapSafe (node:internal/modules/cjs/loader:1176:20)\r\n    at Module._compile (node:internal/modules/cjs/loader:1218:27)\r\n    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)\r\n    at Module.load (node:internal/modules/cjs/loader:1117:32)\r\n    at Module._load (node:internal/modules/cjs/loader:958:12)\r\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\r\n    at node:internal/main/run_main_module:23:47\r\n\r\nNode.js v18.15.0\r\n")
[2024-05-18T09:19:54+02:00 ERROR util] crates\lsp\src/lsp.rs:773: server shut down
[2024-05-18T09:19:55+02:00 ERROR util] crates\lsp\src/lsp.rs:357: cannot read LSP message headers
[2024-05-18T09:19:55+02:00 ERROR project] failed to start language server "intelephense": oneshot canceled
[2024-05-18T09:19:55+02:00 ERROR project] server stderr: Some("node:internal/modules/cjs/loader:1078\r\n  throw err;\r\n  ^\r\n\r\nError: Cannot find module 'C:\\C:\\Users\\efdal\\AppData\\Local\\Zed\\extensions\\work\\php\\node_modules\\intelephense\\lib\\intelephense.js'\r\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)\r\n    at Module._load (node:internal/modules/cjs/loader:920:27)\r\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\r\n    at node:internal/main/run_main_module:23:47 {\r\n  code: 'MODULE_NOT_FOUND',\r\n  requireStack: []\r\n}\r\n\r\nNode.js v18.15.0\r\n")
[2024-05-18T09:19:55+02:00 ERROR util] crates\lsp\src/lsp.rs:773: server shut down
[2024-05-18T09:19:55+02:00 ERROR util] crates\languages\src\tailwind.rs:229: missing executable in directory "C:\\Users\\efdal\\AppData\\Local\\Zed\\languages\\tailwindcss-language-server\\node_modules"
[2024-05-18T09:19:55+02:00 ERROR util] crates\lsp\src/lsp.rs:357: cannot read LSP message headers
[2024-05-18T09:19:55+02:00 ERROR project] failed to start language server "tailwindcss-language-server": oneshot canceled
[2024-05-18T09:19:55+02:00 ERROR project] server stderr: Some("node:internal/modules/cjs/loader:1078\r\n  throw err;\r\n  ^\r\n\r\nError: Cannot find module 'C:\\Users\\efdal\\AppData\\Local\\Zed\\languages\\tailwindcss-language-server\\node_modules\\.bin\\tailwindcss-language-server'\r\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)\r\n    at Module._load (node:internal/modules/cjs/loader:920:27)\r\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\r\n    at node:internal/main/run_main_module:23:47 {\r\n  code: 'MODULE_NOT_FOUND',\r\n  requireStack: []\r\n}\r\n\r\nNode.js v18.15.0\r\n")
[2024-05-18T09:19:55+02:00 ERROR util] crates\lsp\src/lsp.rs:773: server shut down
[2024-05-18T09:19:56+02:00 ERROR util] crates\lsp\src/lsp.rs:357: cannot read LSP message headers
[2024-05-18T09:19:56+02:00 ERROR project] failed to start language server "vscode-html-language-server": oneshot canceled
[2024-05-18T09:19:56+02:00 ERROR project] server stderr: Some("node:internal/modules/cjs/loader:1078\r\n  throw err;\r\n  ^\r\n\r\nError: Cannot find module 'C:\\C:\\Users\\efdal\\AppData\\Local\\Zed\\extensions\\work\\html\\node_modules\\vscode-langservers-extracted\\bin\\vscode-html-language-server'\r\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)\r\n    at Module._load (node:internal/modules/cjs/loader:920:27)\r\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\r\n    at node:internal/main/run_main_module:23:47 {\r\n  code: 'MODULE_NOT_FOUND',\r\n  requireStack: []\r\n}\r\n\r\nNode.js v18.15.0\r\n")
[2024-05-18T09:19:56+02:00 ERROR util] crates\lsp\src/lsp.rs:773: server shut down
[2024-05-18T09:19:56+02:00 ERROR util] crates\language\src\language_registry.rs:877: server container removal

Caused by:
    The system cannot find the file specified. (os error 2)
[2024-05-18T09:19:56+02:00 ERROR util] crates\languages\src\tailwind.rs:229: The system cannot find the path specified. (os error 3)
[2024-05-18T09:19:56+02:00 ERROR util] crates\language\src\language_registry.rs:877: server container removal

Caused by:
    The system cannot find the file specified. (os error 2)
[2024-05-18T09:19:56+02:00 ERROR util] crates\lsp\src/lsp.rs:357: cannot read LSP message headers
[2024-05-18T09:19:56+02:00 ERROR project] failed to start language server "tailwindcss-language-server": oneshot canceled
[2024-05-18T09:19:56+02:00 ERROR project] server stderr: Some("node:internal/modules/cjs/loader:1078\r\n  throw err;\r\n  ^\r\n\r\nError: Cannot find module 'C:\\Users\\efdal\\AppData\\Local\\Zed\\languages\\tailwindcss-language-server\\node_modules\\.bin\\tailwindcss-language-server'\r\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)\r\n    at Module._load (node:internal/modules/cjs/loader:920:27)\r\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\r\n    at node:internal/main/run_main_module:23:47 {\r\n  code: 'MODULE_NOT_FOUND',\r\n  requireStack: []\r\n}\r\n\r\nNode.js v18.15.0\r\n")
[2024-05-18T09:19:56+02:00 ERROR util] crates\lsp\src/lsp.rs:773: server shut down
[2024-05-18T09:19:57+02:00 ERROR util] crates\language\src\language_registry.rs:877: server container removal

Caused by:
    The system cannot find the file specified. (os error 2)
[2024-05-18T09:19:57+02:00 ERROR util] crates\lsp\src/lsp.rs:357: cannot read LSP message headers
[2024-05-18T09:19:57+02:00 ERROR project] failed to start language server "intelephense": oneshot canceled
[2024-05-18T09:19:57+02:00 ERROR project] server stderr: Some("node:internal/modules/cjs/loader:1078\r\n  throw err;\r\n  ^\r\n\r\nError: Cannot find module 'C:\\C:\\Users\\efdal\\AppData\\Local\\Zed\\extensions\\work\\php\\node_modules\\intelephense\\lib\\intelephense.js'\r\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)\r\n    at Module._load (node:internal/modules/cjs/loader:920:27)\r\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\r\n    at node:internal/main/run_main_module:23:47 {\r\n  code: 'MODULE_NOT_FOUND',\r\n  requireStack: []\r\n}\r\n\r\nNode.js v18.15.0\r\n")
[2024-05-18T09:19:57+02:00 ERROR util] crates\lsp\src/lsp.rs:773: server shut down
[2024-05-18T09:19:57+02:00 ERROR util] crates\languages\src\tailwind.rs:229: The system cannot find the path specified. (os error 3)
[2024-05-18T09:19:57+02:00 ERROR util] crates\language\src\language_registry.rs:877: server container removal

Caused by:
    The system cannot find the file specified. (os error 2)
[2024-05-18T09:19:57+02:00 ERROR util] crates\lsp\src/lsp.rs:357: cannot read LSP message headers
[2024-05-18T09:19:57+02:00 ERROR project] failed to start language server "tailwindcss-language-server": oneshot canceled
[2024-05-18T09:19:57+02:00 ERROR project] server stderr: Some("node:internal/modules/cjs/loader:1078\r\n  throw err;\r\n  ^\r\n\r\nError: Cannot find module 'C:\\Users\\efdal\\AppData\\Local\\Zed\\languages\\tailwindcss-language-server\\node_modules\\.bin\\tailwindcss-language-server'\r\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)\r\n    at Module._load (node:internal/modules/cjs/loader:920:27)\r\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\r\n    at node:internal/main/run_main_module:23:47 {\r\n  code: 'MODULE_NOT_FOUND',\r\n  requireStack: []\r\n}\r\n\r\nNode.js v18.15.0\r\n")
[2024-05-18T09:19:57+02:00 ERROR util] crates\lsp\src/lsp.rs:773: server shut down
[2024-05-18T09:19:58+02:00 ERROR util] crates\lsp\src/lsp.rs:357: cannot read LSP message headers
[2024-05-18T09:19:58+02:00 ERROR project] failed to start language server "eslint": oneshot canceled
[2024-05-18T09:19:58+02:00 ERROR project] server stderr: Some("node:internal/modules/cjs/loader:1078\r\n  throw err;\r\n  ^\r\n\r\nError: Cannot find module 'C:\\Users\\efdal\\AppData\\Local\\Zed\\languages\\eslint\\vscode-eslint-release\\vscode-eslint\\server\\out\\eslintServer.js'\r\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)\r\n    at Module._load (node:internal/modules/cjs/loader:920:27)\r\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\r\n    at node:internal/main/run_main_module:23:47 {\r\n  code: 'MODULE_NOT_FOUND',\r\n  requireStack: []\r\n}\r\n\r\nNode.js v18.15.0\r\n")
[2024-05-18T09:19:58+02:00 ERROR util] crates\lsp\src/lsp.rs:773: server shut down
[2024-05-18T09:19:58+02:00 ERROR util] crates\lsp\src/lsp.rs:357: cannot read LSP message headers
[2024-05-18T09:19:58+02:00 ERROR project] failed to start language server "vscode-html-language-server": oneshot canceled
[2024-05-18T09:19:58+02:00 ERROR project] server stderr: Some("node:internal/modules/cjs/loader:1078\r\n  throw err;\r\n  ^\r\n")
[2024-05-18T09:19:58+02:00 ERROR util] crates\lsp\src/lsp.rs:773: server shut down
[2024-05-18T09:19:58+02:00 ERROR util] crates\language\src\language_registry.rs:877: server container removal

Caused by:
    The system cannot find the file specified. (os error 2)
[2024-05-18T09:19:58+02:00 ERROR util] crates\languages\src\tailwind.rs:229: The system cannot find the path specified. (os error 3)
[2024-05-18T09:19:58+02:00 ERROR util] crates\language\src\language_registry.rs:877: server container removal

Caused by:
    The system cannot find the file specified. (os error 2)
[2024-05-18T09:19:59+02:00 ERROR util] crates\lsp\src/lsp.rs:357: cannot read LSP message headers
[2024-05-18T09:19:59+02:00 ERROR project] failed to start language server "tailwindcss-language-server": oneshot canceled
[2024-05-18T09:19:59+02:00 ERROR project] server stderr: Some("node:internal/modules/cjs/loader:1078\r\n  throw err;\r\n  ^\r\n\r\nError: Cannot find module 'C:\\Users\\efdal\\AppData\\Local\\Zed\\languages\\tailwindcss-language-server\\node_modules\\.bin\\tailwindcss-language-server'\r\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)\r\n    at Module._load (node:internal/modules/cjs/loader:920:27)\r\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\r\n    at node:internal/main/run_main_module:23:47 {\r\n  code: 'MODULE_NOT_FOUND',\r\n  requireStack: []\r\n}\r\n\r\nNode.js v18.15.0\r\n")
[2024-05-18T09:19:59+02:00 ERROR util] crates\lsp\src/lsp.rs:773: server shut down
[2024-05-18T09:19:59+02:00 ERROR project] Hit 4 reinstallation attempts for "tailwindcss-language-server"
[2024-05-18T09:19:59+02:00 ERROR util] crates\languages\src\typescript.rs:433: The system cannot find the path specified. (os error 3)
[2024-05-18T09:19:59+02:00 ERROR util] crates\language\src\language_registry.rs:877: server container removal

Caused by:
    The system cannot find the file specified. (os error 2)
[2024-05-18T09:19:59+02:00 ERROR util] crates\lsp\src/lsp.rs:357: cannot read LSP message headers
[2024-05-18T09:19:59+02:00 ERROR project] failed to start language server "eslint": oneshot canceled
[2024-05-18T09:19:59+02:00 ERROR project] server stderr: Some("node:internal/modules/cjs/loader:1078\r\n  throw err;\r\n  ^\r\n\r\nError: Cannot find module 'C:\\Users\\efdal\\AppData\\Local\\Zed\\languages\\eslint\\vscode-eslint-release\\vscode-eslint\\server\\out\\eslintServer.js'\r\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)\r\n    at Module._load (node:internal/modules/cjs/loader:920:27)\r\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\r\n    at node:internal/main/run_main_module:23:47 {\r\n  code: 'MODULE_NOT_FOUND',\r\n  requireStack: []\r\n}\r\n\r\nNode.js v18.15.0\r\n")
[2024-05-18T09:19:59+02:00 ERROR util] crates\lsp\src/lsp.rs:773: server shut down
[2024-05-18T09:19:59+02:00 ERROR util] crates\lsp\src/lsp.rs:357: cannot read LSP message headers
[2024-05-18T09:19:59+02:00 ERROR project] failed to start language server "intelephense": oneshot canceled
[2024-05-18T09:19:59+02:00 ERROR project] server stderr: Some("node:internal/modules/cjs/loader:1078\r\n  throw err;\r\n  ^\r\n\r\nError: Cannot find module 'C:\\C:\\Users\\efdal\\AppData\\Local\\Zed\\extensions\\work\\php\\node_modules\\intelephense\\lib\\intelephense.js'\r\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)\r\n    at Module._load (node:internal/modules/cjs/loader:920:27)\r\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\r\n    at node:internal/main/run_main_module:23:47 {\r\n  code: 'MODULE_NOT_FOUND',\r\n  requireStack: []\r\n}\r\n\r\nNode.js v18.15.0\r\n")
[2024-05-18T09:19:59+02:00 ERROR util] crates\lsp\src/lsp.rs:773: server shut down
[2024-05-18T09:19:59+02:00 ERROR util] crates\language\src\language_registry.rs:877: server container removal

Caused by:
    The system cannot find the file specified. (os error 2)
[2024-05-18T09:20:00+02:00 ERROR util] crates\lsp\src/lsp.rs:357: cannot read LSP message headers
[2024-05-18T09:20:00+02:00 ERROR project] failed to start language server "vscode-html-language-server": oneshot canceled
[2024-05-18T09:20:00+02:00 ERROR project] server stderr: Some("node:internal/modules/cjs/loader:1078\r\n  throw err;\r\n  ^\r\n\r\nError: Cannot find module 'C:\\C:\\Users\\efdal\\AppData\\Local\\Zed\\extensions\\work\\html\\node_modules\\vscode-langservers-extracted\\bin\\vscode-html-language-server'\r\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)\r\n    at Module._load (node:internal/modules/cjs/loader:920:27)\r\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\r\n    at node:internal/main/run_main_module:23:47 {\r\n  code: 'MODULE_NOT_FOUND',\r\n  requireStack: []\r\n}\r\n\r\nNode.js v18.15.0\r\n")
[2024-05-18T09:20:00+02:00 ERROR util] crates\lsp\src/lsp.rs:773: server shut down
[2024-05-18T09:20:00+02:00 ERROR util] crates\languages\src\typescript.rs:433: The system cannot find the path specified. (os error 3)
[2024-05-18T09:20:00+02:00 ERROR util] crates\language\src\language_registry.rs:877: server container removal

Caused by:
    The system cannot find the file specified. (os error 2)
[2024-05-18T09:20:00+02:00 ERROR util] crates\lsp\src/lsp.rs:357: cannot read LSP message headers
[2024-05-18T09:20:00+02:00 ERROR project] failed to start language server "eslint": oneshot canceled
[2024-05-18T09:20:00+02:00 ERROR project] server stderr: Some("node:internal/modules/cjs/loader:1078\r\n  throw err;\r\n  ^\r\n\r\nError: Cannot find module 'C:\\Users\\efdal\\AppData\\Local\\Zed\\languages\\eslint\\vscode-eslint-release\\vscode-eslint\\server\\out\\eslintServer.js'\r\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)\r\n    at Module._load (node:internal/modules/cjs/loader:920:27)\r\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\r\n    at node:internal/main/run_main_module:23:47 {\r\n  code: 'MODULE_NOT_FOUND',\r\n  requireStack: []\r\n}\r\n\r\nNode.js v18.15.0\r\n")
[2024-05-18T09:20:00+02:00 ERROR util] crates\lsp\src/lsp.rs:773: server shut down
[2024-05-18T09:20:00+02:00 ERROR util] crates\language\src\language_registry.rs:877: server container removal

Caused by:
    The system cannot find the file specified. (os error 2)
[2024-05-18T09:20:01+02:00 ERROR util] crates\language\src\language_registry.rs:877: server container removal

Caused by:
    The system cannot find the file specified. (os error 2)
[2024-05-18T09:20:01+02:00 ERROR util] crates\lsp\src/lsp.rs:357: cannot read LSP message headers
[2024-05-18T09:20:01+02:00 ERROR project] failed to start language server "intelephense": oneshot canceled
[2024-05-18T09:20:01+02:00 ERROR project] server stderr: Some("node:internal/modules/cjs/loader:1078\r\n  throw err;\r\n  ^\r\n\r\nError: Cannot find module 'C:\\C:\\Users\\efdal\\AppData\\Local\\Zed\\extensions\\work\\php\\node_modules\\intelephense\\lib\\intelephense.js'\r\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)\r\n    at Module._load (node:internal/modules/cjs/loader:920:27)\r\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\r\n    at node:internal/main/run_main_module:23:47 {\r\n  code: 'MODULE_NOT_FOUND',\r\n  requireStack: []\r\n}\r\n\r\nNode.js v18.15.0\r\n")
[2024-05-18T09:20:01+02:00 ERROR project] Hit 4 reinstallation attempts for "intelephense"
[2024-05-18T09:20:01+02:00 ERROR util] crates\lsp\src/lsp.rs:773: server shut down
[2024-05-18T09:20:01+02:00 ERROR util] crates\languages\src\typescript.rs:433: The system cannot find the path specified. (os error 3)
[2024-05-18T09:20:01+02:00 ERROR util] crates\language\src\language_registry.rs:877: server container removal

Caused by:
    The system cannot find the file specified. (os error 2)
[2024-05-18T09:20:01+02:00 ERROR util] crates\lsp\src/lsp.rs:357: cannot read LSP message headers
[2024-05-18T09:20:01+02:00 ERROR project] failed to start language server "eslint": oneshot canceled
[2024-05-18T09:20:01+02:00 ERROR project] server stderr: Some("node:internal/modules/cjs/loader:1078\r\n  throw err;\r\n  ^\r\n\r\nError: Cannot find module 'C:\\Users\\efdal\\AppData\\Local\\Zed\\languages\\eslint\\vscode-eslint-release\\vscode-eslint\\server\\out\\eslintServer.js'\r\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)\r\n    at Module._load (node:internal/modules/cjs/loader:920:27)\r\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\r\n    at node:internal/main/run_main_module:23:47 {\r\n  code: 'MODULE_NOT_FOUND',\r\n  requireStack: []\r\n}\r\n\r\nNode.js v18.15.0\r\n")
[2024-05-18T09:20:01+02:00 ERROR project] Hit 4 reinstallation attempts for "eslint"
[2024-05-18T09:20:01+02:00 ERROR util] crates\lsp\src/lsp.rs:773: server shut down
[2024-05-18T09:20:01+02:00 ERROR util] crates\lsp\src/lsp.rs:357: cannot read LSP message headers
[2024-05-18T09:20:01+02:00 ERROR project] failed to start language server "vscode-html-language-server": oneshot canceled
[2024-05-18T09:20:01+02:00 ERROR project] server stderr: Some("node:internal/modules/cjs/loader:1078\r\n  throw err;\r\n  ^\r\n\r\nError: Cannot find module 'C:\\C:\\Users\\efdal\\AppData\\Local\\Zed\\extensions\\work\\html\\node_modules\\vscode-langservers-extracted\\bin\\vscode-html-language-server'\r\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)\r\n    at Module._load (node:internal/modules/cjs/loader:920:27)\r\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\r\n    at node:internal/main/run_main_module:23:47 {\r\n  code: 'MODULE_NOT_FOUND',\r\n  requireStack: []\r\n}\r\n\r\nNode.js v18.15.0\r\n")
[2024-05-18T09:20:01+02:00 ERROR util] crates\lsp\src/lsp.rs:773: server shut down
[2024-05-18T09:20:01+02:00 ERROR project] Hit 4 reinstallation attempts for "vscode-html-language-server"
CharlesChen0823 commented 6 months ago

you might not installed lsp from the log?

Z3NTL3 commented 6 months ago

you might not installed lsp from the log?

The associated LSP's (should) automatically get installed when installing a language extension. I'd like to note that I do not think that this is the actual problem because Zed does install the appropiate LSP, however I am facing errors like: "cannot read LSP message headers", for most languages.

tommy141x commented 6 months ago

I am also having this issue with a fresh build, something changed recently that's causing this.

tommy141x commented 6 months ago

I think I found the problem, however I am unsure what file provides the dir.

Through my own debugging and in the log in your issue, these are the paths where the module "is not found"

From your log: C:\\C:\\Users\\efdal\\AppData\\Local\\Zed\\extensions\\work\\html\\node_modules\\vscode-langservers-extracted\\bin\\vscode-html-language-server

From my log: C:\\C:\\Users\\tommy\\AppData\\Local\\Zed\\extensions\\work\\html\\node_modules\\vscode-langservers-extracted\\bin\\vscode-html-language-server

I have verified the file does exist there but as you can see from the logs, we have this C:\\C:\\, which I believe is the issue.

Also printing from tailwind.rs inside get_cached_server_binary, the "server_path" value has a node_modules folder inside a node_modules folder which I believe is wrong:

Server path: "C:\\Users\\tommy\\AppData\\Local\\Zed\\languages\\tailwindcss-language-server\\node_modules\\node_modules/.bin/tailwindcss-language-server"

beans42 commented 5 months ago

Also printing from tailwind.rs inside get_cached_server_binary, the "server_path" value has a node_modules folder inside a node_modules folder which I believe is wrong:

The duplicate "node_modules" is a problem for get_cached_server_binary but on macos, this doesn't even seem to get used. In fetch_server_binary, container_dir will be something like "...\AppData\Local\Zed\languages\tailwindcss-language-server". Fixing the wrong path-seperator makes it work (tailwind lsp specifically).

const SERVER_PATH: &'static [&'static str] = &[
    "node_modules",
    "@tailwindcss",
    "language-server",
    "bin",
    "tailwindcss-language-server"
];
    async fn fetch_server_binary(
        &self,
        latest_version: Box<dyn 'static + Send + Any>,
        container_dir: PathBuf,
        _: &dyn LspAdapterDelegate,
    ) -> Result<LanguageServerBinary> {
        let latest_version = latest_version.downcast::<String>().unwrap();
        //changed this v
        let mut server_path = container_dir.clone();
        for p in SERVER_PATH.iter() {
            server_path = server_path.join(p);
        }

and in get_cached_server_binary

        let last_version_dir = last_version_dir.ok_or_else(|| anyhow!("no cached binary"))?;
        //changed this v
        let mut server_path = last_version_dir.clone();
        for p in SERVER_PATH.iter() {
            server_path = server_path.join(p);
        }

I also changed the path to "node_modules/@tailwindcss/language-server/bin/tailwindcss-language-server" because on macos, the "tailwindcss-language-server" file is a symlink to the actual script but on windows the ".bin" folder's "tailwindcss-language-server" is a sh script. image

This needs to be done for atleast the following files:

Ianec21 commented 5 months ago

Same error here.

mikamero commented 4 months ago

same issue here, any fix yet?

superboxes commented 4 months ago

same issue here, any fix yet?

did you atleast try what beans42 said?

mikamero commented 4 months ago

same issue here, any fix yet?

did you atleast try what beans42 said?

well, i did change the tailwind and emmet like said @beans42, but the emmet doesnt work, perhaps it has a different path? also i couldnt find async fetch_server_binary and get_cached_server_binary one for the emmet, so i only change the const SERVER_PATH: for the emmet like so : const SERVER_PATH: &'static [&'static str] = &[ "node_modules", "@emmettio", "language-server", "bin", "emmet-language-server" ]; but it still didnt worked, anything i did wrong?

superboxes commented 4 months ago

same issue here, any fix yet?

did you atleast try what beans42 said?

well, i did change the tailwind and emmet like said @beans42, but the emmet doesnt work, perhaps it has a different path? also i couldnt find async fetch_server_binary and get_cached_server_binary one for the emmet, so i only change the const SERVER_PATH: for the emmet like so : const SERVER_PATH: &'static [&'static str] = &[ "node_modules", "@emmettio", "language-server", "bin", "emmet-language-server" ]; but it still didnt worked, anything i did wrong?

well if its different you'll have to do it a bit different, but the logic stays the same. so you can change and write the code yourself or wait for someone else to do so.

pokrad commented 2 months ago

Well, I noticed the same error in tailwind... invalid LSP message header "Windows PowerShell\r\nCopyright (C) Microsoft Corporation. All rights reserved.\r\n\r\n"

And it seems to me that the problem is because powershell spits out it's greeting message to standard output, which then confuses the LSP ???

Indeed, when i change line 28 in tailwind.rs to: vec!["-nologo".into(), server_path.into(), "--stdio".into()]

basically adding "-nologo" parameter, the error is gone from the logs...

anay-208 commented 1 month ago

I'm facing the same issue, however, I got it fixed for tailwind in #17741

vipexv commented 1 month ago

I'm having the same issue on latest build.

JoelDoryoku commented 1 month ago

Hi, I was having the same error with several LSPs. For example, when Zed tried to start a new LSP for Svelte, it threw the following error:

2024-10-15T21:08:45.5659771+02:00 [INFO] starting language server process. binary path: "C:\\Program Files\\nodejs\\node.exe", working directory: "I:\\ProyectosWeb\\GrowFund", args: ["/C:\\Users\\joell\\AppData\\Local\\Zed\\extensions\\work\\svelte/node_modules/svelte-language-server/bin/server.js", "--stdio"]
2024-10-15T21:08:45.6236236+02:00 [ERROR] cannot read LSP message headers
2024-10-15T21:08:45.6239995+02:00 [ERROR] Failed to start language server "svelte-language-server": oneshot canceled
2024-10-15T21:08:45.6241354+02:00 [ERROR] server stderr: "node:internal/modules/cjs/loader:1080\r\n  throw err;\r\n  ^\r\n\r\nError: Cannot find module 'I:\\C:\\Users\\joell\\AppData\\Local\\Zed\\extensions\\work\\svelte\\node_modules\\svelte-language-server\\bin\\server.js'\r\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)\r\n    at Module._load (node:internal/modules/cjs/loader:922:27)\r\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:86:12)\r\n    at node:internal/main/run_main_module:23:47 {\r\n  code: 'MODULE_NOT_FOUND',\r\n  requireStack: []\r\n}\r\n\r\nNode.js v18.18.0\r\n"

The problem is that in the args, Zed somehow adds a slash at the beginning, letting Windows take that slash as the root of the working directory, leaving the result as I:\C:\ in my case.

The workaround until a solid one arrives, is as follows: Add a replace in the arg variable to change the slash in crates/extension/src/extension_lsp_adapter.rs line 91.

Old:

Ok(LanguageServerBinary {
    path,
    arguments: command.args.into_iter().map(|arg| arg.into()).collect(),
    env: Some(command.env.into_iter().collect()),
})

New:

Ok(LanguageServerBinary {
    path,
    arguments: command.args.into_iter().map(|arg| arg.replace("/C:\\", "C:\\").into()).collect(),
    env: Some(command.env.into_iter().collect()),
})

Now, the log prints the following:

2024-10-15T23:31:25.6712345+02:00 [INFO] starting language server process. binary path: "C:\\Program Files\\nodejs\\node.exe", working directory: "I:\\ProyectosWeb\\GrowFund", args: ["C:\\Users\\joell\\AppData\\Local\\Zed\\extensions\\work\\svelte/node_modules/svelte-language-server/bin/server.js", "--stdio"]

As a result, Svelte suggestions/imports and Emmet inside .svelte files works perfectly.

I'm posting this comment because it worked for me and I'll be glad if it helps anyone else. I know this is a crappy solution, but at least, the extensions are working on Windows.

If anyone has another solution, I would be happy to see it.

001123 commented 1 month ago

image Got this error message if I change it to the following @JoelDoryoku answer 🤔

JoelDoryoku commented 1 month ago

image Got this error message if I change it to the following @JoelDoryoku answer 🤔

Me too with PHP and HTML extensions. My solution worked for me with Astro, Svelte and SCSS extensions.

In this error, it looks like Zed is trying to run a bash script on windows. Maybe related to the slash at the beginning of the arg.

vipexv commented 3 weeks ago

@JoelDoryoku Solution doesn't seem to work for me.