Developing Theia on windows

I ran into some OS related issues, my language server does not connect in the windows version I build via electron-builder and I want to debug what happens on a windows system. Trying to start the locally build browser version of my theia (with some of my extensions) results in the follwoing error:

Error: The specified module could not be found.

\?<workspace>\node_modules\vscode-nsfw\build\Release\nsfw.node

at Object.Module._extensions..node (module.js:682:18)

at Module.load (module.js:566:32)

at tryModuleLoad (module.js:506:12)

at Function.Module._load (module.js:498:3)

at Module.require (module.js:597:17)

at require (internal/module.js:11:18)

at Object.<anonymous> (<workspace>\node_modules\vscode-nsfw\lib\src\index.js:3:16)

at Module._compile (module.js:653:30)

at Object.Module._extensions..js (module.js:664:10)

at Module.load (module.js:566:32)

Server worker has been disconnected. [ID: 1 | PID: 2432]

Server worker failed to start within 5000 milliseconds.

Pass a greater value as ‘–startup-timeout’ option to increase the timeout or a ne

gative to disable.

Done in 2.53s.

I checked, \node_modules\vscode-nsfw\build\Release\nsfw.node does exist. Any idea why this happens?

[original thread by Sören Domrös]

What’s ?

[Sören Domrös]

that’s the path to my root diretory where my package.json is

Yes, but what’s the value?

some tools have trouble with spaces, etc.

[Sören Domrös]

Ok, there are no spaces :slight_smile:

[Sören Domrös]

The full path is C:\Users\sdo\Documents\repos\keith\node_modules…

[Sören Domrös]

I can build an electron app locally via electron builder and run it (it does not connect to the language server correctly but starts the LS. That’s why I am trying to debug it)

[Nitika Sharma]

you can try removing node_modules and do yarn from scratch and instead of yarn start try with yarn start --startup-timeout -1

[Sören Domrös]

@nitika Did that and got the same result.

[Sören Domrös]

While trying something I got the following message: root WARN Widget was activated, but did not accept focus: code-editor-opener:file:///c%3A/Users/sdo/

[Sören Domrös]

Maybe the ‘:’ in the path is a problem

@kittaakos @thegecko Do you have a clue what is going on? I don’t’ have much experience on windows and with electron-builder.

@sdo, the electron-builder does not work well with the yarn workspace. It cannot resolve dependencies hoisted to the root node_modules folder. What did you try to do? Do you have an example repository?

[Sören Domrös]

@kittaakos I use yarn workspaces. The product build via electron builder has some unspecified problems. The language server starts, but nothing more happens. The problem I described happens without the involvement of electron-builder. I built my product using yarn and tried to execute the browser version of the product (all on windows). This resulted in the error posted above. The theia-hello-world-extension executes fine if I try to execute the browser version.

[Sören Domrös]

I am able to build and start the browser version of yangster. The language server connects, but I am not able to open the diagram widget.

[Sören Domrös]

I updated all dependencies and removed the postinstall script for electron-builder and it seems to work now…

Great!

[Sören Domrös]

It does however not give me any insight what the original problem is: My Theia application sends the initialze message: {“jsonrpc”:“2.0”,“id”:0,“method”:“initialize”,“params”:{“rootPath”:“c:/Users/sdo/Documents/repos/models”,“rootUri”:“file:///c%3A/Users/sdo/Documents/repos/models”,“capabilities”:{“workspace”:{“applyEdit”:true,“workspaceEdit”:{“documentChanges”:true},“didChangeConfiguration”:{“dynamicRegistration”:true},“didChangeWatchedFiles”:{“dynamicRegistration”:true},“symbol”:{“dynamicRegistration”:true,“symbolKind”:{“valueSet”:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},“executeCommand”:{“dynamicRegistration”:true},“workspaceFolders”:true},“textDocument”:{“publishDiagnostics”:{“relatedInformation”:true},“synchronization”:{“dynamicRegistration”:true,“willSave”:true,“willSaveWaitUntil”:true,“didSave”:true},“completion”:{“dynamicRegistration”:true,“contextSupport”:true,“completionItem”:{“snippetSupport”:true,“commitCharactersSupport”:true,“documentationFormat”:[“markdown”,“plaintext”],“deprecatedSupport”:true,“preselectSupport”:true},“completionItemKind”:{“valueSet”:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},“hover”:{“dynamicRegistration”:true,“contentFormat”:[“markdown”,“plaintext”]},“signatureHelp”:{“dynamicRegistration”:true,“signatureInformation”:{“documentationFormat”:[“markdown”,“plaintext”]}},“definition”:{“dynamicRegistration”:true},“references”:{“dynamicRegistration”:true},“documentHighlight”:{“dynamicRegistration”:true},“documentSymbol”:{“dynamicRegistration”:true,“symbolKind”:{“valueSet”:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},“hierarchicalDocumentSymbolSupport”:true},“codeAction”:{“dynamicRegistration”:true,“codeActionLiteralSupport”:{“codeActionKind”:{“valueSet”:["",“quickfix”,“refactor”,“refactor.extract”,“refactor.inline”,“refactor.rewrite”,“source”,“source.organizeImports”]}}},“codeLens”:{“dynamicRegistration”:true},“formatting”:{“dynamicRegistration”:true},“rangeFormatting”:{“dynamicRegistration”:true},“onTypeFormatting”:{“dynamicRegistration”:true},“rename”:{“dynamicRegistration”:true},“documentLink”:{“dynamicRegistration”:true},“typeDefinition”:{“dynamicRegistration”:true},“implementation”:{“dynamicRegistration”:true},“colorProvider”:{“dynamicRegistration”:true},“foldingRange”:{“dynamicRegistration”:true,“rangeLimit”:5000,“lineFoldingOnly”:true}}},“trace”:“off”,“workspaceFolders”:[{“uri”:“file:///c%3A/Users/sdo/Documents/repos/models”,“name”:“file:///c%3A/Users/sdo/Documents/repos/models”}],“processId”:13356}} but the LS never answers.

Well, that sounds like you need to debug your language server, no?