monaco-languageclient icon indicating copy to clipboard operation
monaco-languageclient copied to clipboard

An error appears when it calls languageClient.start()

Open cztflove opened this issue 4 years ago • 12 comments

I follow the example to use the language client but I have no idea why it goes wrong when it calls languageClient.start() image the message is: Request initialize failed with message: The "path" argument must be of type string or an instance of Buffer or URL. Received null

cztflove avatar Aug 04 '21 14:08 cztflove

Can you provide more context please? What is the object you're printing?

CGNonofr avatar Aug 04 '21 14:08 CGNonofr

Can you provide more context please? What is the object you're printing? my object is printed from the function addMessageToQueue of vscode-jsonrpc image image

cztflove avatar Aug 04 '21 14:08 cztflove

@cztflove It's strange because there is no path on the initialize request. There is rootPath and rootUri though.

What language server are you trying to connect to?

rcjsuen avatar Aug 04 '21 15:08 rcjsuen

@cztflove It's strange because there is no path on the initialize request. There is rootPath and rootUri though.

What language server are you trying to connect to?

typescript

cztflove avatar Aug 04 '21 15:08 cztflove

What language server are you trying to connect to?

typescript

Which one though?

Since you're in a debugger you can clearly step through the code. Are you able to pause execution and see what the initialize request you are sending to the server looks like?

rcjsuen avatar Aug 04 '21 15:08 rcjsuen

What language server are you trying to connect to?

typescript

Which one though?

Since you're in a debugger you can clearly step through the code. Are you able to pause execution and see what the initialize request you are sending to the server looks like? I use https://github.com/theia-ide/typescript-language-server

the initialize request is the following image image image

cztflove avatar Aug 04 '21 16:08 cztflove

@cztflove Looks like your rootPath and rootUri are null so that's probably your problem.

rcjsuen avatar Aug 04 '21 16:08 rcjsuen

@cztflove Looks like your rootPath and rootUri are null so that's probably your problem.

but these two params seem not required, I will have a try to fix it, Thanks

cztflove avatar Aug 04 '21 17:08 cztflove

@rcjsuen I am so confused about the use of rootUri, can you please explain for me? According to the example of typescript-language-server, it points to a local file path, but in a real case, we have no such dictionary in the project

cztflove avatar Aug 05 '21 08:08 cztflove

@rcjsuen I am so confused about the use of rootUri, can you please explain for me? According to the example of typescript-language-server, it points to a local file path, but in a real case, we have no such dictionary in the project

Where is your language server running? Inside a Docker container? Just give it a path to an empty folder for now. It doesn't matter if there are files in it or not so don't think about it too much right now.

We're still in the debugging and experimenting phase and trying to see if this is a solution/workaround.

rcjsuen avatar Aug 05 '21 10:08 rcjsuen

@cztflove Hi, Were you able to solve it? I am getting the same error, when trying to run it with typescript language server.

pawansingh00 avatar Nov 04 '21 08:11 pawansingh00

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 09 '22 02:01 stale[bot]

@cztflove please, try again with the latest version. I am closing this issue. If there are further questions please open a discussion: https://github.com/TypeFox/monaco-languageclient/discussions

If you think there is an issue, please open a new one.

Thank you

kaisalmen avatar Oct 19 '22 07:10 kaisalmen