urbit / hoon-language-server

Language Server for Hoon. Middleware to translate between the Language Server Protocol and your Urbit.
MIT License
36 stars 10 forks source link

Language Server crashed immediately #10

Open dylanirlbeck opened 4 years ago

dylanirlbeck commented 4 years ago

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 commented 4 years ago

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.