I’m seeing the “Cannot find a service for the path” error on Windows when running the electron app
using the Theia extension generator example from https://github.com/theia-ide/generator-theia-extension/tree/master/templates/backend. Other backend services appear to be registering successfully. I’ve reproduced on two different Windows 10 machines. This issue does not happen on Linux, both example backend services work as expected.
Debug console message
root ERROR Cannot find a service for the path: /services/withClient
root ERROR Cannot find a service for the path: /services/helloBackend
I’ve traced the error to https://github.com/eclipse-theia/theia/blob/master/packages/core/src/node/messaging/messaging-contribution.ts#L163, but am new to this world and have not seen anything glaringly obvious when debugging in the developer tools.
Does the electron app need to be run with a special configuration or permission on windows or is there something different that needs to be done with registering services in Windows?
Any guidance would greatly be appreciated.
@scottaxcell I tested on
Windows 10 but cannot reproduce the problem you’re facing. My steps are:
Backend Communication as the extension type
yarn rebuild:electron && yarn --cwd electron-app
yarn --cwd electron-app start
The app starts normally, I then verified:
Say hello on the backend
Say hello on the backend with a callback from the client
work as expected (outputs
Hello World and
Hello Client respectively in the debug console).
Can you please clarify if you did the same steps? Or did you include any customizations I should know about?
@DukeNgn thanks for clarifying the steps and leading me to discover that this is a VS Code specific issue.
Using the same steps you outlined and running from the command prompt I do not see the issue. I see the expected outputs. So that’s great! The problem persists when running the same steps, but instead running using the
Start Electron Backend launch configuration in VS Code.
Consider this issue closed. I’ll update this thread if and when I can get the VS Code launch configuration to work as expected.
I was able to resolve this issue by updating the args in the launch configuration to match below. I think the key was adding the