adamvoss / vscode-yaml

YAML language support, including JSON Schema validation, for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=adamvoss.yaml
MIT License
29 stars 5 forks source link

yaml server crashing #22

Closed bcatubig closed 4 years ago

bcatubig commented 6 years ago

Running vscode on osx. Tried re-installing the plugin but no luck.

TypeError: Cannot read property 'forEach' of undefined
    at JSONValidation.doValidation (/Users/brandon/.vscode/extensions/adamvoss.yaml-0.0.10/server/node_modules/vscode-json-languageservice/lib/services/jsonValidation.js:47:38)
    at yamlDocument.documents.map.d (/Users/brandon/.vscode/extensions/adamvoss.yaml-0.0.10/server/node_modules/vscode-yaml-languageservice/lib/yamlLanguageService.js:48:71)
    at Array.map (native)
    at Object.doValidation (/Users/brandon/.vscode/extensions/adamvoss.yaml-0.0.10/server/node_modules/vscode-yaml-languageservice/lib/yamlLanguageService.js:48:62)
    at validateTextDocument (/Users/brandon/.vscode/extensions/adamvoss.yaml-0.0.10/server/out/yamlServerMain.js:215:21)
    at Timeout._onTimeout (/Users/brandon/.vscode/extensions/adamvoss.yaml-0.0.10/server/out/yamlServerMain.js:205:9)
    at ontimeout (timers.js:386:14)
    at tryOnTimeout (timers.js:250:5)
    at Timer.listOnTimeout (timers.js:214:5)
[Error - 9:03:17 AM] Connection to server got closed. Server will not be restarted.
jnunderwood commented 6 years ago

Confirmed on Ubuntu 16.04.3 as well. Using plugin version 0.0.10.

adamvoss commented 6 years ago

Thanks for the reports! This is probably why it is important to lock dependency versions in npm, which this does not do. I merged a PR that updated the README and triggered a release yesterday so that seems to be the only thing that would cause it to break.

I'm not at a box where I can work on a new release right now. I tried manually re-packaging the 0.0.9 build, but VSCode doesn't seem to like that and it kept thinking the extension needed to be updated. I have unpublished the extension for now to avoid breaking further users.

For now, you could manually install 0.0.9 or you could try out the redhat.vscode-yaml extension

yolio2003 commented 6 years ago

thank you ! install 0.0.9 works

bashfulrobot commented 6 years ago

Just piping in here. I am experiencing this on V 0.0.10.

enable
/home/dustin/.vscode/extensions/adamvoss.yaml-0.0.10/server/node_modules/vscode-json-languageservice/lib/services/jsonValidation.js:47
            jsonDocument.syntaxErrors.forEach(addProblem);
                                     ^

TypeError: Cannot read property 'forEach' of undefined
    at JSONValidation.doValidation (/home/dustin/.vscode/extensions/adamvoss.yaml-0.0.10/server/node_modules/vscode-json-languageservice/lib/services/jsonValidation.js:47:38)
    at yamlDocument.documents.map.d (/home/dustin/.vscode/extensions/adamvoss.yaml-0.0.10/server/node_modules/vscode-yaml-languageservice/lib/yamlLanguageService.js:48:71)
    at Array.map (native)
    at Object.doValidation (/home/dustin/.vscode/extensions/adamvoss.yaml-0.0.10/server/node_modules/vscode-yaml-languageservice/lib/yamlLanguageService.js:48:62)
    at validateTextDocument (/home/dustin/.vscode/extensions/adamvoss.yaml-0.0.10/server/out/yamlServerMain.js:215:21)
    at Timeout._onTimeout (/home/dustin/.vscode/extensions/adamvoss.yaml-0.0.10/server/out/yamlServerMain.js:205:9)
    at ontimeout (timers.js:386:14)
    at tryOnTimeout (timers.js:250:5)
    at Timer.listOnTimeout (timers.js:214:5)
[Info  - 01:15:42] Connection to server got closed. Server will restart.
dquist commented 6 years ago

Currently getting this stack trace on V0.0.10

enable
C:\Users\dquist\.vscode\extensions\adamvoss.yaml-0.0.10\server\node_modules\vscode-yaml-languageservice\lib\parser\yamlParser.js:219
        errors.forEach(e => _doc.errors.push(e));
                                       ^

TypeError: Cannot read property 'push' of undefined
    at errors.forEach.e (C:\Users\dquist\.vscode\extensions\adamvoss.yaml-0.0.10\server\node_modules\vscode-yaml-languageservice\lib\parser\yamlParser.js:219:40)
    at Array.forEach (native)
    at createJSONDocument (C:\Users\dquist\.vscode\extensions\adamvoss.yaml-0.0.10\server\node_modules\vscode-yaml-languageservice\lib\parser\yamlParser.js:219:16)
    at yamlDocs.map.doc (C:\Users\dquist\.vscode\extensions\adamvoss.yaml-0.0.10\server\node_modules\vscode-yaml-languageservice\lib\parser\yamlParser.js:255:53)
    at Array.map (native)
    at Object.parse (C:\Users\dquist\.vscode\extensions\adamvoss.yaml-0.0.10\server\node_modules\vscode-yaml-languageservice\lib\parser\yamlParser.js:255:42)
    at Object.parseYAMLDocument (C:\Users\dquist\.vscode\extensions\adamvoss.yaml-0.0.10\server\node_modules\vscode-yaml-languageservice\lib\yamlLanguageService.js:65:59)
    at C:\Users\dquist\.vscode\extensions\adamvoss.yaml-0.0.10\server\out\yamlServerMain.js:232:117
    at Object.get (C:\Users\dquist\.vscode\extensions\adamvoss.yaml-0.0.10\server\out\languageModelCache.js:34:33)
    at getJSONDocument (C:\Users\dquist\.vscode\extensions\adamvoss.yaml-0.0.10\server\out\yamlServerMain.js:240:26)
[Info  - 8:43:53 PM] Connection to server got closed. Server will restart.
enable
C:\Users\dquist\.vscode\extensions\adamvoss.yaml-0.0.10\server\node_modules\vscode-yaml-languageservice\lib\parser\yamlParser.js:219
        errors.forEach(e => _doc.errors.push(e));
                                       ^
JPinkney commented 6 years ago

If you are interested in a working alternative we have one here: redhat.vscode-yaml. At one point we were looking at merging this one and ours but that never fully went through. As a result we have all the features of this one + other features like autocompletion + pulling most used schemas from the schemastore automatically (like .travis.yml schemas for example) and more!

lig commented 6 years ago

@JPinkney it looks like redhat.vscode-yaml hasn't got autoformat feature.

bcatubig commented 4 years ago

Closing. RIP @adamvoss -- thanks for all your hard work.