coc-ccls icon indicating copy to clipboard operation
coc-ccls copied to clipboard

extension "coc-ccls" doesn't contain main file

Open qadzifi opened this issue 5 years ago • 13 comments

I accidentally delete my neovim plugged directory and when I try to open neovim again I get this message

extension "coc-ccls" doesn't contain main file

Expected behavior

No error message.

System information

  • OS: Ubuntu 18.04
  • Editor: neovim

qadzifi avatar Mar 15 '20 10:03 qadzifi

I have this same error message, but I did not delete the ~/.vim/plugged dir. Any ideas on how to fix this?

Uninstalling and reinstalling did not fix.

alichtman avatar Mar 21 '20 00:03 alichtman

I had the same issue with the error [coc.nvim]extension "coc-ccls" doesn't contain main file /path/to/home/.config/coc/extensions/node_modules/coc-ccls/lib/extension.js.

So kind of "fixed it" temporarily by doing:

cd ~/.config/coc/extensions/node_modules/coc-ccls
ln -s node_modules/ws/lib lib

Nelyah avatar Mar 26 '20 09:03 Nelyah

@Nelyah Is this a permanent fix? I've been seeing the same issue since past few weeks. The error starting showing up without any changes, except maybe updates to the plugin/vim.

surmish avatar Apr 02 '20 21:04 surmish

@surmish If by permanent you mean it persists through reboot, then yes. However, although it fixes the issue, it doesn't fix its root cause (file not being at its supposed location in the first place). The error is most likely due to a plugin update in which the file moved and its old location was still trying to be accessed.

This fix should hold until the plugin gets updated again with a fix for the underlying issue.

Nelyah avatar Apr 03 '20 08:04 Nelyah

Same issue, error started to show up when I updated coc with :PlugUpdate.

aganm avatar Apr 05 '20 15:04 aganm

I'm also having this issue. Can confirm the temporary fix in the comment from @Nelyah makes the error go away.

Paul-Houser avatar Apr 12 '20 03:04 Paul-Houser

I had the same issue with the error [coc.nvim]extension "coc-ccls" doesn't contain main file /path/to/home/.config/coc/extensions/node_modules/coc-ccls/lib/extension.js.

So kind of "fixed it" temporarily by doing:

cd ~/.config/coc/extensions/node_modules/coc-ccls
ln -s node_modules/ws/lib lib

Small Correction It should be

cd ~/.config/coc/extensions/node_modules/coc-ccls
ln -s ../ws/lib lib

yamsu avatar Apr 17 '20 12:04 yamsu

@yamsu Hm, that would point to the lib folder ~/.config/coc/extensions/node_modules/coc-ccls/../ws/lib which doesn't exist on my end.

Maybe the location varies depending on the version 🤷‍♀️

Nelyah avatar Apr 17 '20 15:04 Nelyah

Yeah I guess there is a difference in the directory structure. I had to use

ln -s ../ws/lib lib

From the coc-ccls directory, but this solution works thanks.

yamsu avatar Apr 17 '20 16:04 yamsu

Having the same issue though I can't seem to fix it in the same way. I don't have any "ws/lib" folder, the one I have is inside .config/nvim/plugged/coc.nvim/lib and it doesn't have an "extension.js" file but an "extensions.js" file (note the "s" at the end).

I have symlinked it to the file coc-ccls expects and it indeed does seem to work, but I don't think this is intended in any way since none of my other coc pluggins require this weird symlink...

DiegoGuidaF avatar Apr 18 '20 19:04 DiegoGuidaF

Running: cd ~/.config/coc/node_modules/coc-ccls; npm install; python build.py

creates the required lib directory. However, when opening a file that starts coc-ccls, one gets the following error: image

Edit: Apart from that error, the extensions seems to be working, since errors get detected and showed. Edit2: https://github.com/Maxattax97/coc-ccls/issues/3#issue-600116270

ythomop avatar Apr 27 '20 20:04 ythomop

I had the same trouble.

In my case, Error says, [coc.nvim]extension "coc-ccls" doesn't contain main file /path/to/home/.config/coc/extensions/node_modules/coc-ccls/lib/extension.js.

But extension.js is actually placed at /path/to/home/.config/coc/extensions/node_modules/coc-ccls/node_modules/ws/lib/extension.js. and, coc-ccls/ does not have lib dir. So, at /coc-ccls

mkdir lib
cd lib
ln -s ../node_modules/ws/lib/extension.js ./extension.js

solve the problem

Ueeek avatar May 13 '20 10:05 Ueeek

Adding the script I ended up adding to my dotfiles (based on the above code snippets), should be copy-pastable unless you installed coc-ccls to a different directory (in which case it should do nothing):

set -x
existing=~/.config/coc/extensions/node_modules/coc-ccls/node_modules/ws/lib/extension.js
missing=~/.config/coc/extensions/node_modules/coc-ccls/lib/extension.js
if [[ -e "$existing" && ! -e "$missing" ]]; then
  mkdir -p "$(dirname "$missing")"
  ln -s "$existing" "$missing"
fi
set +x

gibfahn avatar Sep 17 '20 09:09 gibfahn