Skip to content

vue-language-server fails to start if initializationOptions is undefined #1188

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

Closed
3 tasks done
louisbourque opened this issue Apr 7, 2019 · 2 comments · Fixed by #1191
Closed
3 tasks done

vue-language-server fails to start if initializationOptions is undefined #1188

louisbourque opened this issue Apr 7, 2019 · 2 comments · Fixed by #1191

Comments

@louisbourque
Copy link
Contributor

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

Info

Problem

When using SublimeText with the LSP plugin, with vue-language-server, I get the following error in the SublimeText console:

LSP: Request initialize failed with message: Cannot read property 'config' of undefined

Reproducible Case

I've traced the error back to this line:

_.get(params.initializationOptions.config, ['vetur', 'useWorkspaceDependencies'], false)

If params.initializationOptions is undefined, a TypeError occurs, preventing the init function from continuing. This line was added in a recent commit here: 7f49878

In that same file, there is a check to ensure params.initializationOptions exists before attempting to access config:

if (params.initializationOptions && params.initializationOptions.config) {
      this.configure(params.initializationOptions.config);
}

If possible, I would like to submit a Pull Request for this, which would consist of this commit:
https://github.com/louisbourque/vetur/commit/3cc0b83827dda78ad2775e8688e6efd45b1d9318

@sgehrman
Copy link

sgehrman commented Apr 7, 2019

I'm also on Linux/Vetur. Says Language Server Crashed. I just updated to the new VSCode, I assume that triggered it.

@octref
Copy link
Member

octref commented Apr 8, 2019

The change looks good. Wanna send a PR?

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

Successfully merging a pull request may close this issue.

3 participants