vscode-elixir-ls: Extension fails to load after upgrade to v0.6.0
Environment
- Elixir & Erlang versions (elixir --version): Elixir 1.10.3, Erlang/OTP 22
- VSCode ElixirLS version: v0.6.0
- Operating System Version: Linux (Ubuntu 16.04)
Troubleshooting
- Restart your editor (which will restart ElixirLS) sometimes fixes issues
- Stop your editor, remove the entire
.elixir_lsdirectory, then restart your editor
- Create a new Mix project with
mix new empty, then open that project with VS Code and open an Elixir file. Is your issue reproducible on the empty project? If not, please publish a repo on Github that does reproduce it. - Check the output log by opening
View > Outputand selecting “ElixirLS” in the dropdown. Please include any output that looks relevant. (If ElixirLS isn’t in the dropdown, the server failed to launch.) - Check the developer console by opening
Help > Toggle Developer Toolsand include any errors that look relevant.
Description
The extension fails to properly load after upgrading to v0.6.0. Syntax highlighting works but other features like autocompletion, navigation, deps fetching and PLT build do not work and the extension does not appear in the dropdown under View > Output.
A Cannot find module 'shelljs' error is printed in the DevTools console.


About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 16 (2 by maintainers)
temporary solution, run
npm iin~/.vscode/extensions/jakebecker.elixir-ls-0.6.0Sorry about this! After investigating it looks like there were two issues, one was that I was hit by https://github.com/microsoft/vscode-vsce/issues/494 which caused the extension to not start because the dependencies were not installed. This issue could be worked around with https://github.com/elixir-lsp/vscode-elixir-ls/issues/145#issuecomment-703249412
The second issue was that I built the package with Elixir 1.10, and that caused the extension to not run on any project using an earlier elixir version which caused the
function ElixirLS.LanguageServer.CLI.main/0 is undefinederror.But the good new is that I just released v0.6.1 that fixes both those issues. Didn’t make a PR but this is the commit that bumps the version and adds a reminder to use the
.release-tool-versionswhen publishing the extension: https://github.com/elixir-lsp/vscode-elixir-ls/commit/6ef324bbb9ed0e1889eca9471bfec57f4a60ce6a🆗 I found this issue https://github.com/microsoft/vscode-vsce/issues/494 to confirm that it’s bug from
vsceI’ve also been experiencing this issue today. I tried @AidasPa’s temporary workaround. But, like other commenters, I ran into issues when ElixirLS would start up.
I think I’ve identified a temporary workaround that does indeed work, based on @iporsut’s comments that this is ultimately a
vscebug.Steps:
vscode-elixir-lslocally. Ensure the symlinkedelixir-lsrepo is also cloned to your local machine.npm installnpx vsce package --no-yarncode --install-extension elixir-ls-0.6.0.vsixFor more info, see the Packaging extensions guide from the VSCode docs.
@bceskavich 's Solution works but the LS does not start for an umbrella project, though working for a non-umbrella project. Crashes with
@AidasPa 's Installing ~/.vscode/extensions/jakebecker.elixir-ls-0.6.0 also did not work for me, led to some other error.
I resorted to the previous version. I will just try an update after the fix is made 😄
Seem like
vsce1.81.0detected touseYarnin this project. So it doesn’t get npm dependencies. We have to force it that not use yarn byvsce package --no-yarn.@AidasPa that temporary solution worked for me! Thanks.
I’m experiencing the same. This is the error I’m getting:
[2020-10-04 06:48:35.485] [exthost] [error] Activating extension JakeBecker.elixir-ls failed due to an error: [2020-10-04 06:48:35.486] [exthost] [error] Error: Cannot find module ‘shelljs’ Require stack: