-
Notifications
You must be signed in to change notification settings - Fork 29k
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
uncaught exception from ProxyChannel.fromService #192365
Comments
I've just spent quite a while debugging my own trivial extension and why it was failing to launch under the debugger to arrive at exactly this issue. Below is the call stack and some custom logging I added at the start when promise is undefined. It matches the above analysis.
|
Note: Turns out the extension was failing for a different reason, but this error led me on a wild goose chase for quite a few hours thinking it was the problem, so would be good to fix :) |
@mroch @billti good findings, would you like to contribute a PR with a fix? Maybe here we should check on the return type and wrap into a vscode/src/vs/base/parts/ipc/common/ipc.ts Line 1132 in e95fca1
|
this code requires that
IServerChannel.call
returns a promise:vscode/src/vs/base/parts/ipc/common/ipc.ts
Lines 420 to 428 in 9c17df5
otherwise, the
then()
call fails. in the example below, it returnsundefined
, which does not have a.then
property.but
ProxyChannel.fromService
is unsound. it is typed to return a Promise, but iftarget()
doesn't return a promise then its return type is a lie:vscode/src/vs/base/parts/ipc/common/ipc.ts
Lines 1108 to 1123 in 9c17df5
this
ProxyChannel.fromService
is a problem:vscode/src/vs/code/node/sharedProcess/sharedProcessMain.ts
Lines 398 to 400 in 9c17df5
because it has methods that don't return promises:
vscode/src/vs/platform/telemetry/common/telemetry.ts
Lines 65 to 66 in 9c17df5
this leads to, in my case at least, an uncaught exception in sharedProcess.
I added this in ipc.ts and it logged this while debugging extensions:
Call returned undefined: customEndpointTelemetry.publicLog([object Object],js-debug/launch,[object Object])
The text was updated successfully, but these errors were encountered: