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

Unable to start language server on v0.7.6 #2260

Closed
mjohansenwork opened this issue Jul 5, 2024 · 7 comments · Fixed by #2261
Closed

Unable to start language server on v0.7.6 #2260

mjohansenwork opened this issue Jul 5, 2024 · 7 comments · Fixed by #2261
Assignees
Labels
bug Something isn't working

Comments

@mjohansenwork
Copy link

Description

I'm running into an error with the latest v0.7.6 version of the extension. It looks like the version was bumped quite recently, as of this commit 3537027

This is the error message (found in the VSCode output extension host logs):

Cannot find module 'vscode-languageclient/node'

I installed v0.7.5 and it works.

@mjohansenwork mjohansenwork added the bug Something isn't working label Jul 5, 2024
@davidrunger
Copy link

davidrunger commented Jul 5, 2024

I am seeing the same thing. The "Ruby LSP" VS Code extension is not working at all at version v0.7.6 or v0.7.7 (pre-release). Downgrading to v0.7.5 gets it working again. (Tip: see here for how to downgrade.)

None of the extension's functionality seems to be working (e.g. underlining RuboCop violations, or autocorrecting them when I hit my configured key combination). If I open the VS Code command palette and choose "Ruby LSP: Restart", then I get this error message:

Command 'Ruby LSP: Restart' resulted in an error

command 'rubyLsp.restart' not found

(and likewise for other Ruby LSP commands that I have tried to execute from the command palette, such as stop and start).

I am on Linux (MX Linux / Debian).

In the VS Code "Output" panel, there is no "Ruby LSP" option available in the select/dropdown. If I choose "Extension Host" in the "Output" panel, there is this error (Cannot find module 'vscode-languageclient/node') and stack trace (as mentioned in the initial bug report):

2024-07-05 14:27:02.754 [info] ExtensionService#_doActivateExtension Shopify.ruby-lsp, startup: true, activationEvent: 'workspaceContains:Gemfile.lock'
2024-07-05 14:27:02.788 [error] Activating extension Shopify.ruby-lsp failed due to an error:
2024-07-05 14:27:02.789 [error] Error: Cannot find module 'vscode-languageclient/node'
Require stack:
- /home/david/.vscode/extensions/shopify.ruby-lsp-0.7.7/out/extension.js
- /usr/share/code/resources/app/out/vs/loader.js
- /usr/share/code/resources/app/out/bootstrap-amd.js
- /usr/share/code/resources/app/out/bootstrap-fork.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1055:15)
    at Function.i._resolveFilename (node:electron/js2c/utility_init:2:13405)
    at Module._load (node:internal/modules/cjs/loader:908:27)
    at Function.c._load (node:electron/js2c/node_init:2:13672)
    at Function.S._load (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:177:6035)
    at Function.n._load (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:174:31788)
    at Function.i._load (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:139:34301)
    at Module.require (node:internal/modules/cjs/loader:1122:19)
    at h (/usr/share/code/resources/app/out/vs/loader.js:4:647)
    at Object.<anonymous> (/home/david/.vscode/extensions/shopify.ruby-lsp-0.7.7/out/extension.js:1:780)
    at Module.o._compile (/usr/share/code/resources/app/out/vs/loader.js:4:1271)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1311:10)
    at Module.load (node:internal/modules/cjs/loader:1098:32)
    at Module._load (node:internal/modules/cjs/loader:945:12)
    at Function.c._load (node:electron/js2c/node_init:2:13672)
    at Function.S._load (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:177:6035)
    at Function.n._load (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:174:31788)
    at Function.i._load (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:139:34301)
    at Module.require (node:internal/modules/cjs/loader:1122:19)
    at require (node:internal/modules/helpers:130:18)
    at Function.i [as __$__nodeRequire] (/usr/share/code/resources/app/out/vs/loader.js:5:98)
    at m.xb (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:174:32967)
    at async Promise.all (index 0)

image

@vinistock
Copy link
Member

Thanks for reporting! For now, please downgrade to the previous version while we investigate the issue.

@Earlopain
Copy link
Contributor

Earlopain commented Jul 5, 2024

The extension bundle is not bundled right, 1.6k vs the 15k lines of code is was previously. I suspect this esbuild issue to be highly relevant. evanw/esbuild#3819. I'd try bumping esbuild to 0.23 or downgrading to 0.21

@vinistock
Copy link
Member

That would explain why a runtime dependency is suddenly missing without us changing anything in the package.json declarations.

I'll try upgrading.

@vinistock
Copy link
Member

Yeah, upgrading fixes the bundling issues. @Earlopain thank you so much for the pointer, this was extremely helpful.

#2261 will fix it and I'll cut releases for both stable and preview momentarily.

@vinistock
Copy link
Member

Alright, v0.7.8 stable and v0.7.9 preview are published and should auto-upgrade as soon as they become available in the marketplace, which typically takes a few minutes.

Thanks for reporting everybody!

@davidrunger
Copy link

I can confirm that v0.7.8 and v0.7.9 are both working for me in VS Code. 👍 Thank you for the super quick fix @vinistock and for the pointer to the problem and solution @Earlopain !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants