question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

coc.nvim fails to start language server with error about "unregistered dependency token ElmWorkspaces"

See original GitHub issue

I’ve used coc.nvim for a while with a variety of languages and I’m trying to get started with Elm. I’ve installed this language server and its dependencies in my local node_modules directory and configured coc.nvim like so:

{
  ...
    "elmLS": {
      "command": "./assets/node_modules/.bin/elm-language-server",
      "filetypes": ["elm"],
      "rootPatterns": ["elm.json"],
      "elmPath": "./assets/node_modules/.bin/elm",
      "elmReviewPath": "./assets/node_modules/.bin/elm-review",
      "elmFormatPath": "./assets/node_modules/.bin/elm-format",
      "elmTestPath": "./assets/node_modules/.bin/elm-test",
    },
   ...
}

Expected Behavior

coc.nvim starts the language server and I can write Elm code using neovim and code completion, syntax checking etc.

Current Behavior

When I start coc.nvim it gives me this message:

Server languageserver.elmLS failed to start: Pm [Error]: Request
initialize failed with message: Attempted to resolve unregistered dependency token: "ElmWorkspaces"
at su (/home/patrick/dotfiles/.config/nvim/plugged/coc.nvim/build/index.js:38:224)
lp (/home/patrick/dotfiles/.config/nvim/plugged/coc.nvim/build/index.js:37:11261)
at
at Immediate. <anonymous> (/home/patrick/dotfiles/.config/nvim/plugged/coc.nvim/build/index.js:37:11111)
at process Immediate (node: internal/timers:464:21) {
code: -32603,
data: undefined

Possible Solution

Not sure I can help here just yet. Was looking through the source of both coc.nvim and elm-language-server and it’s hard to tell where this error is even coming from. I suspect it’s from a dependency of elm-language-server.

Steps to Reproduce

  1. Install elm-language-server and its dependencies
  2. Configure coc.nvim
  3. Edit a Elm file

Your Environment

  • Version used: 1.6.0
  • Editor used: neovim 0.4.3
  • Environment name and version: Node 16.3.0
  • Operating System and version: Ubuntu 20.04

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
patreeceeocommented, May 22, 2022

That gives me an idea… Yup, it must have been because I hadn’t created an elm.json file yet. Now that that exists in an ancestor directory to the file I’m editing the LS starts up successfully. So, user error, though in the friendly spirit of Elm perhaps the error message should be more helpful?

0reactions
razzeeecommented, Nov 10, 2022

That’s an internal thing to the language server, you won’t know that from learning elm

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when using elm-language-server with neovim and coc
elmLS failed to start: Error: Request initialize failed with message: Attempted to resolve unregistered dependency token: "ElmWorkspaces".
Read more >
coc-ember - npm
Ember language server extension for coc.nvim. Latest version: 1.5.39, last published: 5 days ago. Start using coc-ember in your project by ...
Read more >
coc.nvim | Yarn - Package Manager
LSP based intellisense engine for neovim & vim8. ... When create CocSem highlight group, replace invalid character of token types and token modifiers...
Read more >
neoclide/coc.nvim - Gitter
bingo will return diagnostics info and i use [C ]C to jump error. Andy Walker ... @chemzqm I still have problems with starting...
Read more >
problem with coc vim and julia server - Reddit
I tried to add an autocompletion for vim but the language server crashed every time i open a julia file, this is the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found