clangd / coc-clangd

clangd extension for coc.nvim
Apache License 2.0
757 stars 34 forks source link

Command CocCommand clangd.install fails with error 'Failed to install clangd language server' #651

Closed jrmd54 closed 7 months ago

jrmd54 commented 7 months ago

This error occurs on a fresh install. I added coc.nvim plugin and built it with command 'npm ci' coc-clangd is then downloaded automatically when vim is started. Since there is no clangd binary yet in my ~/.config/ folder, i have to run the command ':CocCommand clangd.install' (as requested when i open a .cpp file).

But the command fails with the following error message: [coc.nvim] Failed to install clangd language server: TypeError: Expected signal to be an instanceof AbortSignal You may want to install it manually.. See https://clangd.llvm.org/installation.html.

Thank you very much for your insight.

jrmd54 commented 7 months ago

From what i found it is possible this bug is caused by node-fetch (https://github.com/node-fetch/node-fetch/issues/784). I tried rebuilding coc-clangd from the repository with npm install, while changing version of node-fetch in package-lock.json, but it had no effect. But maybe i did something wrong, i admit i am not very proficient with node.

fannheyward commented 7 months ago

What's your Node.js version?

jrmd54 commented 7 months ago

It was 18.8. Just in case i upgraded it to 20.11 (latest) and reinstalled coc-clangd plugin, but the error still shows up.

fannheyward commented 7 months ago

Tested with Node.js v18.19.0 but can't reproduce.

I made a fix in coc-clangd v0.30.2, give it a test please.

jrmd54 commented 7 months ago

Hello,

It works, thank you very much!