monaco-languageclient
monaco-languageclient copied to clipboard
An error appears when it calls languageClient.start()
I follow the example to use the language client
but I have no idea why it goes wrong when it calls languageClient.start()
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
Can you provide more context please? What is the object you're printing?
Can you provide more context please? What is the object you're printing? my object is printed from the function addMessageToQueue of vscode-jsonrpc
![]()
@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?
@cztflove It's strange because there is no
pathon theinitializerequest. There isrootPathandrootUrithough.What language server are you trying to connect to?
typescript
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?
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
initializerequest 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

@cztflove Looks like your rootPath and rootUri are null so that's probably your problem.
@cztflove Looks like your
rootPathandrootUriarenullso that's probably your problem.
but these two params seem not required, I will have a try to fix it, Thanks
@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
@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.
@cztflove Hi, Were you able to solve it? I am getting the same error, when trying to run it with typescript language server.
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.
@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
