loading...
Cover image for Fixing coc-tsserver errors due to Deno
Salted Bytes

Fixing coc-tsserver errors due to Deno

jimatjibba profile image James G. Best Originally published at jamesbest.tech ・1 min read

This is a quick post detailing how to fix issues with coc-tsserver.

I am a long term Neovim user and feel that the only Intellisense engine to use is CocVim. It is simply amazing. It breathes so much power into you Vim setup.

I write Typescript daily and so use the coc-tsserver plugin. It gives all the power of VSCodes typescript engine in NeoVim. But recently it broke. It was reporting errors when there was nothing wrong. I made sure all my dependencies we up to date and still nothing. All I was seeing was this:

Alt Text

The error message is: The error message is: [tsserver 2307] [E] Cannot find module <import-path>

Something was wrong.

Thankfully someone was having the same issue and had created an issue in the CocVim git repo. It turns out that there is a bug in the coc-deno plugin that has some problems with non-deno projects.

Thankfully the fix is simple. Disable the deno plugin for non deno projects.

With in Vim: :CocList extensions and find the Deno plugin. Press tab and select d to disable it. Restart Vim and all your issues should have disappeared.

Thanks for reading 🙏

If there is anything I have missed, or if there is a better way to do something then please let me kno

Discussion

pic
Editor guide
Collapse
paskausks profile image
Rihards Paskausks

I write deno stuff quite rarely, so I usually just remove the deno plugin entirely and reinstall when i want to work on deno projects again.

I guess, one could make a plugin which disables the deno extension if there's a node_modules or a package.json/package-lock.json in the workspace, or may be there's even a better way to tackle this issue in an ad-hoc way until a proper solution comes around.

Collapse
jimatjibba profile image
James G. Best Author

Yeah, I am hoping it will get fixed. I only installed the deno plugin to have a play so will probably just remove it.