Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After updating to 3.3.0 I'm getting ''Starting process to resolve node module xo failed" and The xo server crashed 5 times in the last 3 minutes. " #99

Closed
darkred opened this issue Oct 13, 2021 · 4 comments

Comments

@darkred
Copy link

darkred commented Oct 13, 2021

After updating the extension to 3.3.0 from 3.2.0 (VSCode 1.61 x64, Node 16.11.1 on win11)
whenever I try to open any folder in VSCode I'm getting these errors:

Starting process to resolve node module xo failed

The xo server crashed 5 times in the last 3 minutes. The server will not be restarted.

A request has failed. See the output for more information.

That is (from bottom to top):
2021-10-13_225842

The output of the 3rd/top message:
[Info  - 10:27:20 PM] XO Server Starting in Node v14.16.0
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn C:\Program Files\Microsoft VS Code\Code.exe ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn C:\\Program Files\\Microsoft VS Code\\Code.exe',
  path: 'C:\\Program Files\\Microsoft VS Code\\Code.exe',
  spawnargs: [
    '-e',
    "var p = process;p.on('message',function(m){if(m.c==='e'){p.exit(0);}else if(m.c==='rs'){try{var r=require.resolve(m.a);p.send({c:'r',s:true,r:r});}catch(err){p.send({c:'r',s:false});}}});",
    ''
  ]
}
[Error - 10:27:20 PM] Error: Starting process to resolve node module  xo failed
    at c:\Users\Kostas\.vscode\extensions\samverschueren.linter-xo-3.3.0\dist\server.js:33:56829
    at new Promise (<anonymous>)
    at Object.Ln [as resolve] (c:\Users\Kostas\.vscode\extensions\samverschueren.linter-xo-3.3.0\dist\server.js:33:56531)
    at ac.resolveXO (c:\Users\Kostas\.vscode\extensions\samverschueren.linter-xo-3.3.0\dist\server.js:46:6977)
    at async ac.getDocumentDiagnostics (c:\Users\Kostas\.vscode\extensions\samverschueren.linter-xo-3.3.0\dist\server.js:46:8838)
    at async ac.lintDocument (c:\Users\Kostas\.vscode\extensions\samverschueren.linter-xo-3.3.0\dist\server.js:46:8100)
[Info  - 10:27:20 PM] Connection to server got closed. Server will restart.
[Info  - 10:27:20 PM] XO Server Starting in Node v14.16.0
[Error - 10:27:21 PM] Error: Starting process to resolve node module  xo failed
    at c:\Users\Kostas\.vscode\extensions\samverschueren.linter-xo-3.3.0\dist\server.js:33:56829
    at new Promise (<anonymous>)
    at Object.Ln [as resolve] (c:\Users\Kostas\.vscode\extensions\samverschueren.linter-xo-3.3.0\dist\server.js:33:56531)
    at ac.resolveXO (c:\Users\Kostas\.vscode\extensions\samverschueren.linter-xo-3.3.0\dist\server.js:46:6977)
    at async ac.getDocumentDiagnostics (c:\Users\Kostas\.vscode\extensions\samverschueren.linter-xo-3.3.0\dist\server.js:46:8838)
    at async ac.lintDocument (c:\Users\Kostas\.vscode\extensions\samverschueren.linter-xo-3.3.0\dist\server.js:46:8100)
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn C:\Program Files\Microsoft VS Code\Code.exe ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn C:\\Program Files\\Microsoft VS Code\\Code.exe',
  path: 'C:\\Program Files\\Microsoft VS Code\\Code.exe',
  spawnargs: [
    '-e',
    "var p = process;p.on('message',function(m){if(m.c==='e'){p.exit(0);}else if(m.c==='rs'){try{var r=require.resolve(m.a);p.send({c:'r',s:true,r:r});}catch(err){p.send({c:'r',s:false});}}});",
    ''
  ]
}
[Info  - 10:27:21 PM] Connection to server got closed. Server will restart.
[Info  - 10:27:21 PM] XO Server Starting in Node v14.16.0
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn C:\Program Files\Microsoft VS Code\Code.exe ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn C:\\Program Files\\Microsoft VS Code\\Code.exe',
  path: 'C:\\Program Files\\Microsoft VS Code\\Code.exe',
  spawnargs: [
    '-e',
    "var p = process;p.on('message',function(m){if(m.c==='e'){p.exit(0);}else if(m.c==='rs'){try{var r=require.resolve(m.a);p.send({c:'r',s:true,r:r});}catch(err){p.send({c:'r',s:false});}}});",
    ''
  ]
}
[Error - 10:27:21 PM] Error: Starting process to resolve node module  xo failed
    at c:\Users\Kostas\.vscode\extensions\samverschueren.linter-xo-3.3.0\dist\server.js:33:56829
    at new Promise (<anonymous>)
    at Object.Ln [as resolve] (c:\Users\Kostas\.vscode\extensions\samverschueren.linter-xo-3.3.0\dist\server.js:33:56531)
    at ac.resolveXO (c:\Users\Kostas\.vscode\extensions\samverschueren.linter-xo-3.3.0\dist\server.js:46:6977)
    at async ac.getDocumentDiagnostics (c:\Users\Kostas\.vscode\extensions\samverschueren.linter-xo-3.3.0\dist\server.js:46:8838)
    at async ac.lintDocument (c:\Users\Kostas\.vscode\extensions\samverschueren.linter-xo-3.3.0\dist\server.js:46:8100)
[Info  - 10:27:21 PM] Connection to server got closed. Server will restart.
[Info  - 10:27:21 PM] XO Server Starting in Node v14.16.0
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn C:\Program Files\Microsoft VS Code\Code.exe ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn C:\\Program Files\\Microsoft VS Code\\Code.exe',
  path: 'C:\\Program Files\\Microsoft VS Code\\Code.exe',
  spawnargs: [
    '-e',
    "var p = process;p.on('message',function(m){if(m.c==='e'){p.exit(0);}else if(m.c==='rs'){try{var r=require.resolve(m.a);p.send({c:'r',s:true,r:r});}catch(err){p.send({c:'r',s:false});}}});",
    ''
  ]
}
[Error - 10:27:22 PM] Error: Starting process to resolve node module  xo failed
    at c:\Users\Kostas\.vscode\extensions\samverschueren.linter-xo-3.3.0\dist\server.js:33:56829
    at new Promise (<anonymous>)
    at Object.Ln [as resolve] (c:\Users\Kostas\.vscode\extensions\samverschueren.linter-xo-3.3.0\dist\server.js:33:56531)
    at ac.resolveXO (c:\Users\Kostas\.vscode\extensions\samverschueren.linter-xo-3.3.0\dist\server.js:46:6977)
    at async ac.getDocumentDiagnostics (c:\Users\Kostas\.vscode\extensions\samverschueren.linter-xo-3.3.0\dist\server.js:46:8838)
    at async ac.lintDocument (c:\Users\Kostas\.vscode\extensions\samverschueren.linter-xo-3.3.0\dist\server.js:46:8100)
[Info  - 10:27:22 PM] Connection to server got closed. Server will restart.
[Info  - 10:27:22 PM] XO Server Starting in Node v14.16.0
[Error - 10:27:22 PM] Error: Starting process to resolve node module  xo failed
    at c:\Users\Kostas\.vscode\extensions\samverschueren.linter-xo-3.3.0\dist\server.js:33:56829
    at new Promise (<anonymous>)
    at Object.Ln [as resolve] (c:\Users\Kostas\.vscode\extensions\samverschueren.linter-xo-3.3.0\dist\server.js:33:56531)
    at ac.resolveXO (c:\Users\Kostas\.vscode\extensions\samverschueren.linter-xo-3.3.0\dist\server.js:46:6977)
    at async ac.getDocumentDiagnostics (c:\Users\Kostas\.vscode\extensions\samverschueren.linter-xo-3.3.0\dist\server.js:46:8838)
    at async ac.lintDocument (c:\Users\Kostas\.vscode\extensions\samverschueren.linter-xo-3.3.0\dist\server.js:46:8100)
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn C:\Program Files\Microsoft VS Code\Code.exe ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn C:\\Program Files\\Microsoft VS Code\\Code.exe',
  path: 'C:\\Program Files\\Microsoft VS Code\\Code.exe',
  spawnargs: [
    '-e',
    "var p = process;p.on('message',function(m){if(m.c==='e'){p.exit(0);}else if(m.c==='rs'){try{var r=require.resolve(m.a);p.send({c:'r',s:true,r:r});}catch(err){p.send({c:'r',s:false});}}});",
    ''
  ]
}
[Error - 10:27:22 PM] Connection to server got closed. Server will not be restarted.

Thank you

@spence-s
Copy link
Collaborator

Interesting @darkred - sorry for the inconvenience - just to cover my bases - do you have xo installed in the workspace? I cannot reproduce this on mac.

And even more odd - I these errors should be caught and handled internally and not crash the server. Not sure if VSCode has some sort of mechanism there that disconnects it...

Anyway - it looks like the error is coming from trying to resolve the path of xo in your folder:
https://github.com/microsoft/vscode-languageserver-node/blob/bc2cb78ed791e297f4f91bdb91934b251f93ff78/server/src/node/files.ts#L92

I assume you've tried restarting VSCode and everything?

@spence-s
Copy link
Collaborator

@darkred I just published a possible fix for this - try 3.3.1 and see if this fixes your issue. Please let me know if this fixes your issues.

@darkred
Copy link
Author

darkred commented Oct 13, 2021

The new version fixes the issue, thanks a lot for the quick response!

To answer your questions:

  • I tested opening folders with XO (e.g. cloned 'Refined GitHub' repo) and without XO (cloned Userscripts repo, by me).
    It occurred in both cases.
  • yes, of course I tried restarting, it would occur every single time I tried opening a folder.

@spence-s
Copy link
Collaborator

The new version fixes the issue, thanks a lot for the quick response
Awesome!

Thank you for testing/letting me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants