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

initializationOptions: Cannot read property 'config' of undefined #1341

Closed
last-partizan opened this issue Jun 23, 2019 · 5 comments
Closed
Labels

Comments

@last-partizan
Copy link

Hi, i'm trying to use vue-language-server with vim and LanguageClient-neovim and it does not work.

I traced bug to this error:

00:54:01 WARN unnamed src/language_server_protocol.rs:2132 Failed to start language server automatically. Error: Failure { jsonrpc: Some(V2), error: Error { code: InternalError, message: "Request initialize failed with message: Cannot read property \'config\' of undefined", data: None }, id: Num(1) }

https://github.com/autozimu/LanguageClient-neovim/blob/next/src/language_server_protocol.rs#L897

Looks like initializationOptions can be null, but vue-language-server does not take this into account here:

logger.setLevel(_.get(params.initializationOptions.config, ['vetur', 'dev', 'logLevel'], 'INFO'));

It looks like trivial issue, can you fix it or should i make pull-request?

@jonboiser
Copy link

jonboiser commented Aug 19, 2019

In my (unsuccessful) attempts to use VLS in atom, I have gotten rid of the errors by moving config into the path array.

It clears up the errors, but I am still not getting messages from the language server in atom.

-  logger.setLevel(_.get(params.initializationOptions.config, ['vetur', 'dev', 'logLevel'], 'INFO')); 
+  logger.setLevel(_.get(params.initializationOptions, ['config', 'vetur', 'dev', 'logLevel'], 'INFO')); 

@zulus
Copy link
Contributor

zulus commented May 7, 2020

Any workaround?

zulus added a commit to zulus/vetur that referenced this issue May 7, 2020
zulus added a commit to zulus/vetur that referenced this issue May 7, 2020
zulus added a commit to zulus/vetur that referenced this issue May 8, 2020
zulus added a commit to zulus/vetur that referenced this issue May 8, 2020
zulus added a commit to zulus/vetur that referenced this issue May 10, 2020
@octref
Copy link
Member

octref commented Jun 8, 2020

@zulus
Copy link
Contributor

zulus commented Jun 8, 2020

No, without my patch I still see same error.

@octref
Copy link
Member

octref commented Jul 30, 2020

Fixed by #1705.

@octref octref closed this as completed Jul 30, 2020
@octref octref added bug and removed need-more-info labels Jul 30, 2020
@octref octref reopened this Jul 30, 2020
@octref octref closed this as completed in 1f0430a Jul 30, 2020
octref added a commit that referenced this issue Jul 30, 2020
Fix #1341 - Make sure initializationOptions is at least empty object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants