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

Language server lsp-vue has crashed, do you want to restart it? #23

Closed
Guanqing-cool opened this issue Apr 12, 2020 · 22 comments
Closed

Comments

@Guanqing-cool
Copy link

After downloading the lsp-vue , I can't use it. Open the Vue file and the message "language server LSP Vue has crashed, do you want to restart it?". It's still useless to restart it. What causes the language server to fail?And how do I fix it。

@rchl
Copy link
Member

rchl commented Apr 12, 2020

Check ST console and LSP: Toggle Log Panel for any relevant errors or paste here.

@Guanqing-cool
Copy link
Author

Check ST console and LSP: Toggle Log Panel for any relevant errors or paste here.

Sorry, the console doesn't seem to show any errors. It's just a sublime text window that pops up when the Vue file is loaded about a problem with the language server. This is my screenshot of the problem.
error

@rchl
Copy link
Member

rchl commented Apr 13, 2020

Check also the other log panel that I've mentioned. You can open it from command palette.

And the contents of Vue file can also be the reason.

@Guanqing-cool
Copy link
Author

Check also the other log panel that I've mentioned. You can open it from command palette.

And the contents of Vue file can also be the reason.

OK, I switched to the log panel with two messages:
lsp-vue: Loaded bundled typescript@3.7.4.
lsp-vue: Vetur initialized
toggle log  panel

@rchl
Copy link
Member

rchl commented Apr 13, 2020

That still doesn't tell us anything.
I saw part off the Vue file in your screenshot and it looked rather weird - you were initialising Vue there which you wouldn't typically do in a Vue file.
Are you able to share the file or whole repo?

@Guanqing-cool
Copy link
Author

That still doesn't tell us anything.
I saw part off the Vue file in your screenshot and it looked rather weird - you were initialising Vue there which you wouldn't typically do in a Vue file.
Are you able to share the file or whole repo?

Thank you for your sincere answer to my question.
At first, in order to test lsp-vue, I just changed the HTML file to Vue file directly.
After your guidance, I used vue cli to create a simple Vue project in cmd.
However, when I used sublime to open the vue file in the project, the previous problems still
occurred.
Do Vue files need any other conditions or environments?
new vue file

@rwols
Copy link
Member

rwols commented Apr 13, 2020

Did you try removing the Vetur language server from Sublime’s Cache dir? Perhaps the installation did not succeed. When Vetur is removed, this package will re-install it.

@rchl
Copy link
Member

rchl commented Apr 13, 2020

It's probably easier to just reinstall lsp-vue package than hunting the cache directory. That will also clear the cache.

There is one thing I forgot to mention before... To possibly see the error that vetur throws, you also should enable all log_* settings in LSP preferences.

@Guanqing-cool
Copy link
Author

Did you try removing the Vetur language server from Sublime’s Cache dir? Perhaps the installation did not succeed. When Vetur is removed, this package will re-install it.

In sublime's cash directory, I did not find the vetur language server. There is a folder called vue -language -server. In its subdirectory, there is the vetursnippets folder.
I tried to reinstall lsp-vue many times, but it still didn't work.

@rwols
Copy link
Member

rwols commented Apr 13, 2020

From your logs:

lsp-vue: throw error;
lsp-vue: ^
lsp-vue:
lsp-vue: Error: Could not find source file: 'c:\Users\Zhu Guanqing\Desktop\code\my-vue\src\App.vue.template'.

Is the file App.vue.template present?

@rchl
Copy link
Member

rchl commented Apr 13, 2020

I don't think it's really supposed to be present on a typical Vue app. Would have to look at vetur code to see why it's expecting that.

@rchl
Copy link
Member

rchl commented Apr 13, 2020

@Guanqing-cool could you first sort out some more fundamental issues like:

Unable to open /C/Users/Zhu Guanqing/Desktop/temp/Sublime Text Build 3211 x64/Data/Packages/LSP/LSP.sublime-settings

?
There is something wrong with accessing files on your system. Possibly because you have everything under Desktop which might have special permission handling.

Maybe install ST properly in Program Files and then try it out again. Could also move your project to user's Documents for example.

@rchl
Copy link
Member

rchl commented Apr 13, 2020

It's also suspicious that you have LSP installed in Packages. It should be installed in Installed Packages if you install it normally through Package Control.

@Guanqing-cool
Copy link
Author

It's also suspicious that you have LSP installed in Packages. It should be installed in Installed Packages if you install it normally through Package Control.

I'm sure I installed it from Package Control in the normal way. I only have three plug-ins installed:
LSP ,Vue Syntax Highlight , lsp-vue
installed package
packages

@Guanqing-cool
Copy link
Author

@Guanqing-cool could you first sort out some more fundamental issues like:

Unable to open /C/Users/Zhu Guanqing/Desktop/temp/Sublime Text Build 3211 x64/Data/Packages/LSP/LSP.sublime-settings

?
There is something wrong with accessing files on your system. Possibly because you have everything under Desktop which might have special permission handling.

Maybe install ST properly in Program Files and then try it out again. Could also move your project to user's Documents for example.

I also installed sublime on disk D, but it still have the same problem. Is it because I use the portable version of sublime?

@rchl
Copy link
Member

rchl commented Apr 13, 2020

What version of node are you running?

@Guanqing-cool
Copy link
Author

What version of node are you running?

v12.14.1

@rchl
Copy link
Member

rchl commented Apr 13, 2020

I'm running the same vetur code, tried same node version and same lsp-vue settings and still can't reproduce.

The error about App.vue.template is confusing because that file is not supposed to exist physically. It's created "virtually" by vetur and passed to typescript for parsing. That parsing fails for you somehow. Not sure what's the actual issue there.

@rchl
Copy link
Member

rchl commented Apr 13, 2020

I've booted my Windows machine and was actually able to reproduce easily there.

Turns out the new version of VLS doesn't crash so I've created PR to update to latest version - #24

@kapitanluffy
Copy link

I made it work for now by using the vls binary found in my path. Here's my fork

If the vls binary does not work, You may need to manually compile vetur server.
The latest vls version (0.2.0) also has this issue vuejs/vetur#1840 (at least for me).

You will then need to manually use the newly compiled version in the plugin.
image

It has an error in linking definitions from the template though. Everything else seem to work fine.
image

It would be great if we can define the binary from the settings instead of relying for it to automatically install node dependencies in the background. I hope you can make yours work 😄

@rchl
Copy link
Member

rchl commented Apr 28, 2020

The whole point of LSP-vue (and other LSP-* packages) is to handle dependencies for you. If you want to use your local dependency, just manually configure LSP like described in https://lsp.readthedocs.io/en/latest/#server-configuration . No need for LSP-vue then.

We know that new VLS version has another crashing issue, that's why we are holding off with #24 .

We could manually compile it, or add extra dependencies, but we'd rather avoid that extra work and just wait for upstream to release new version.

@rchl
Copy link
Member

rchl commented Jul 22, 2020

Should be fixed in just released version https://github.com/sublimelsp/LSP-vue/releases/tag/0.0.18

@rchl rchl closed this as completed Jul 22, 2020
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

Successfully merging a pull request may close this issue.

4 participants