neoclide / coc-yaml

Yaml language server extension for coc.nvim
MIT License
248 stars 23 forks source link

Extension failing to start with error: "The "yaml" server crashed 5 times in the last 3 minutes. The server will not be restarted" #26

Closed rohit-s8 closed 4 years ago

rohit-s8 commented 4 years ago

The error happened as soon as I opened the first yaml file after install. Below is debug output from CocCommand workspace.showOutput

node:internal/modules/cjs/loader:903
  throw err;
  ^

Error: Cannot find module 'vscode-json-languageservice/lib/umd/services/jsonDefinition'
Require stack:
- <HOME>/.config/coc/extensions/node_modules/coc-yaml/node_modules/yaml-language-server/out/server/src/languageservice/services/yamlDefinition.js
- <HOME>/.config/coc/extensions/node_modules/coc-yaml/node_modules/yaml-language-server/out/server/src/languageservice/yamlLanguageService.js
- <HOME>/.config/coc/extensions/node_modules/coc-yaml/node_modules/yaml-language-server/out/server/src/server.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:900:15)
    at Function.Module._load (node:internal/modules/cjs/loader:745:27)
    at Module.require (node:internal/modules/cjs/loader:972:19)
    at require (node:internal/modules/cjs/helpers:88:18)
    at Object.<anonymous> (<HOME>/.config/coc/extensions/node_modules/coc-yaml/node_modules/yaml-language-server/out/server/src/languageservice/services/yamlDefinition.js:5:26)
    at Module._compile (node:internal/modules/cjs/loader:1083:30)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1112:10)
    at Module.load (node:internal/modules/cjs/loader:948:32)
    at Function.Module._load (node:internal/modules/cjs/loader:789:14)
    at Module.require (node:internal/modules/cjs/loader:972:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '<HOME>/.config/coc/extensions/node_modules/coc-yaml/node_modules/yaml-language-server/out/server/src/languageservice/services/yamlDefinition.js',
    '<HOME>/.config/coc/extensions/node_modules/coc-yaml/node_modules/yaml-language-server/out/server/src/languageservice/yamlLanguageService.js',
    '<HOME>/.config/coc/extensions/node_modules/coc-yaml/node_modules/yaml-language-server/out/server/src/server.js'
  ]
}
[Info  - 6:44:16 PM] Connection to server got closed. Server will restart.

Here is also the contents of the directory node_modules/vscode-json-languageservice/lib/umd/services/ showing that the module jsonDefinition does not exist:

❯ tree node_modules/vscode-json-languageservice/lib/umd/services/
node_modules/vscode-json-languageservice/lib/umd/services/
├── configuration.js
├── jsonCompletion.js
├── jsonDocumentSymbols.js
├── jsonFolding.js
├── jsonHover.js
├── jsonLinks.js
├── jsonSchemaService.js
├── jsonSelectionRanges.js
└── jsonValidation.js

0 directories, 9 files
erancx commented 4 years ago

happens here too after update.

CocInfo

## versions

vim version: NVIM v0.4.4
node version: v14.15.0
coc.nvim version: 0.0.79-56bbd049d0
coc.nvim directory: /Users/x/.vim/plugged/coc.nvim
term: iTerm.app
platform: darwin
2020-11-09T12:32:30.699 INFO (pid:40119) [model-installer] - Extension download at /var/folders/lq/_m7b8pkd40g7jslfg_pb9bdh00f272/T/nvim9gL6xs/coc-yaml-N3vxSK
2020-11-09T12:32:30.700 INFO (pid:40119) [model-installer] - Installing dependencies by: /usr/local/bin/npm install --ignore-scripts --no-lockfile --production --legacy-peer-deps.
2020-11-09T12:32:37.082 INFO (pid:40119) [model-installer] - [npm] added 28 packages from 19 contributors and audited 501 packages in 5.997s
2020-11-09T12:32:37.228 INFO (pid:40119) [model-installer] - [npm] found 0 vulnerabilities
2020-11-09T12:32:37.228 INFO (pid:40119) [model-installer] - [npm] 
2020-11-09T12:32:37.260 INFO (pid:40119) [model-installer] - Update package.json at /Users/x/.config/coc/extensions/package.json
2020-11-09T12:32:37.260 INFO (pid:40119) [model-installer] - Installed extension coc-yaml@1.1.0 at /Users/x/.config/coc/extensions/node_modules/coc-yaml
2020-11-09T12:32:37.266 INFO (pid:40119) [services] - registered service "yaml"
2020-11-09T12:32:37.266 INFO (pid:40119) [services] - yaml server state change: stopped => starting
2020-11-09T12:32:37.268 INFO (pid:40119) [language-client-index] - yaml started with 40187
2020-11-09T12:32:37.489 INFO (pid:40119) [services] - yaml server state change: starting => stopped
2020-11-09T12:32:37.489 INFO (pid:40119) [services] - yaml server state change: stopped => starting
2020-11-09T12:32:37.491 INFO (pid:40119) [language-client-index] - yaml started with 40191
2020-11-09T12:32:37.699 INFO (pid:40119) [services] - yaml server state change: starting => stopped
2020-11-09T12:32:37.699 INFO (pid:40119) [services] - yaml server state change: stopped => starting
2020-11-09T12:32:37.701 INFO (pid:40119) [language-client-index] - yaml started with 40192
2020-11-09T12:32:37.906 INFO (pid:40119) [services] - yaml server state change: starting => stopped
2020-11-09T12:32:37.906 INFO (pid:40119) [services] - yaml server state change: stopped => starting
2020-11-09T12:32:37.909 INFO (pid:40119) [language-client-index] - yaml started with 40193
2020-11-09T12:32:38.116 INFO (pid:40119) [services] - yaml server state change: starting => stopped
2020-11-09T12:32:38.116 INFO (pid:40119) [services] - yaml server state change: stopped => starting
2020-11-09T12:32:38.118 INFO (pid:40119) [language-client-index] - yaml started with 40195
2020-11-09T12:32:38.322 INFO (pid:40119) [services] - yaml server state change: starting => stopped
internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module 'vscode-json-languageservice/lib/umd/services/jsonDefinition'
Require stack:
- /Users/x/.config/coc/extensions/node_modules/coc-yaml/node_modules/yaml-language-server/out/server/src/languageservice/services/yamlDefinition.js
- /Users/x/.config/coc/extensions/node_modules/coc-yaml/node_modules/yaml-language-server/out/server/src/languageservice/yamlLanguageService.js
- /Users/x/.config/coc/extensions/node_modules/coc-yaml/node_modules/yaml-language-server/out/server/src/server.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/Users/x/.config/coc/extensions/node_modules/coc-yaml/node_modules/yaml-language-server/out/server/src/languageservice/services/yamlDefinition.js:5:26)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/x/.config/coc/extensions/node_modules/coc-yaml/node_modules/yaml-language-server/out/server/src/languageservice/services/yamlDefinition.js',
    '/Users/x/.config/coc/extensions/node_modules/coc-yaml/node_modules/yaml-language-server/out/server/src/languageservice/yamlLanguageService.js',
    '/Users/x/.config/coc/extensions/node_modules/coc-yaml/node_modules/yaml-language-server/out/server/src/server.js'
  ]
}
[Info  - 12:32:20 PM] Connection to server got closed. Server will restart.

Fixed by running CocInstall coc-yaml@1.0.4

pilot513 commented 4 years ago

It helped me too. Thanks! vim_coc-yaml

chemzqm commented 4 years ago

Please use latest coc.nvim

pilot513 commented 4 years ago

Now: vim version: VIM - Vi IMproved 8.2 8021930 node version: v10.23.0 coc.nvim version: 0.0.79-8230b63641

But error return again :(

erancx commented 4 years ago

I am using the latest version and having the same issue.

## versions

vim version: NVIM v0.4.4
node version: v14.15.0
coc.nvim version: 0.0.79-e1ef9858a7
coc.nvim directory: /Users/x/.vim/plugged/coc.nvim
term: iTerm.app
platform: darwin
- ✓ coc-yaml Current version 1.1.0 is up to date.
chemzqm commented 4 years ago

Yaml requires old vscode-json-languageservice module to work, but npm not follow semver in package.json.

chemzqm commented 4 years ago

Fixed on v1.1.2

erancx commented 4 years ago

great, I can confirm it works!

pilot513 commented 4 years ago

It works for me too. Thanks!

rohit-s8 commented 4 years ago

yup works for me too 👍

sQVe commented 3 years ago

I'm currently getting this issue consistently now on all yaml files. @chemzqm

fev4 commented 3 years ago

It's failing again in 1.4.0, same error message

fev4 commented 3 years ago

Returning to 1.3.1 fixes the issue

chemzqm commented 3 years ago

Dependencies management of yaml-language-server is really bad.

omarabid commented 3 years ago

Same issue (issues here?). at first I thought it's a problem with coc.vim but then TypeScript/Rust autocompletion and formatting works just fine. I can't even get the plugin to install correct (I get "Language client is not ready yet") error.