hoon-language-server icon indicating copy to clipboard operation
hoon-language-server copied to clipboard

Language Server crashed immediately

Open dylanirlbeck opened this issue 5 years ago • 1 comments

Hi all. I'm trying to integrate hoon-language-server with hoon.vim per the instructions in the README. However, I get the following error when I run hoon-language-server from the command line:

❯ hoon-language-server
internal/modules/cjs/loader.js:955
  throw err;
  ^

Error: Cannot find module '../out/server.js'
Require stack:
- /usr/local/lib/node_modules/hoon-language-server/bin/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:952:15)
    at Function.Module._load (internal/modules/cjs/loader.js:835:27)
    at Module.require (internal/modules/cjs/loader.js:1012:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/hoon-language-server/bin/index.js:2:1)
    at Module._compile (internal/modules/cjs/loader.js:1123:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
    at Module.load (internal/modules/cjs/loader.js:972:32)
    at Function.Module._load (internal/modules/cjs/loader.js:872:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/usr/local/lib/node_modules/hoon-language-server/bin/index.js' ]
}

Is there something I'm missing? I ran it manually because in Vim (or Neovim, in my case) the language server kept crashing when I'd open a Hoon file.

Thanks so much!

dylanirlbeck avatar Aug 29 '20 16:08 dylanirlbeck

EDIT: Running tsc to compile the project inside the directory where the global NPM module was installed solved the issue. I'm not sure why the project isn't compiled during postinstall, but I'll look into it to see if I can open a PR.

I'll leave this issue open for now since I think it causes unnecessary friction for LSP consumers.

dylanirlbeck avatar Aug 29 '20 16:08 dylanirlbeck