microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.7k stars 28.7k forks source link

TypeError: Cannot read property 'onError' of undefined #58847

Closed jtsom closed 6 years ago

jtsom commented 6 years ago

Issue Type: Bug

When trying to start a C# application using the debugger, the above message is displayed in an alert and the below is generated in the debugging tools:

/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:2354 TypeError: Cannot read property 'onError' of undefined
    at new t (file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:2579:87)
    at file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:2977:238
    at Object.g [as _notify] (file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:163:807)
    at Object.enter (file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:167:85)
    at n.Class.derive._oncancel._run (file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:168:932)
    at n.Class.derive._oncancel._completed (file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:168:373)
    at e.resolveOk (file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:3197:752)
    at t._receiveReply (file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:3277:748)
    at t._receiveOneMessage (file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:3276:178)
    at file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:3273:553
    at e.fire (file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:184:218)
    at a (file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:320:237)
    at Socket.n._socketDataListener (file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:320:456)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at Pipe.onread (net.js:594:20)

VS Code version: Code - Insiders 1.28.0-insider (7fcd81cd0f88bb2040f249b09cf6bdd83d9ea2ef, 2018-09-17T09:30:49.336Z) OS version: Darwin x64 17.7.0

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz (8 x 2900)| |GPU Status|2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: enabled
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled| |Load (avg)|2, 3, 3| |Memory (System)|16.00GB (0.17GB free)| |Process Argv|/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron -psn_0_716975| |Screen Reader|no| |VM|0%|
Extensions (12) Extension|Author (truncated)|Version ---|---|--- json-to-ts|Mar|1.5.5 ng-template|Ang|0.1.10 path-intellisense|chr|1.4.2 bracket-pair-colorizer|Coe|1.0.60 githistory|don|0.4.2 tslint|eg2|1.0.39 auto-rename-tag|for|0.0.15 Angular2|joh|6.1.5 csharp|ms-|1.16.1 debugger-for-chrome|msj|4.10.1 vscode-docker|Pet|0.2.0 material-icon-theme|PKi|3.6.0 (3 theme extensions excluded)
vscodebot[bot] commented 6 years ago

(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

jtsom commented 6 years ago

Not a duplicate of any of those issues.

YangHanlin commented 6 years ago

It seems to be a bug of the current insiders build, which I also met when debugging C++ programs. Another user of insider build have also had this problem (see #58854). And it seems to have been noticed (see #58849).

danyhoron commented 6 years ago

I also encountered this issue trying to debug a C# netcoreapp2.0.

jtsom commented 6 years ago

Unfortunately, in the latest insiders (d59d9f5aa5708c006e409c1a7b197c27fecb54a4) it's still broken.

jtsom commented 6 years ago

I just ran a test on another machine. I was able to launch and debug a .net core app just fine. The one difference I noticed was in this system I have the LiveShare extension installed and loaded. As a test, I disabled the LiveShare extension and attempted to run the app. This time I received the TypeError error. I re-enabled LiveShare and was able to run the app again. I'm pretty sure I have LiveShare extension disabled on the other system where I noticed this.

A further test of completely uninstalling the LiveShare extension lets me run and debug my app just fine. Re-installing LiveShare returns to the above conditions (disabled == TypeError)

So it looks like even though LiveShare is disabled, something is causing a crash when attempting to run.

2020emm commented 6 years ago

I have the same problem, which began approximately 24 hours ago. The problem breaks most, if not all, of my projects. In addition: dotnet new console - broken, dotnet new webapi - broken, dotnet new mvc - broken Successfully repaired SDK 2.1.402 - did not fix problem Environment: VSCode Insiders, dotnet core sdk version 2.1.402, commit 3599f21f4, runtime environment windows server 2012, os 6.2.9200 (virtual machine), RID win 8-x64, base path c:\Program Fies\dotnet\sdk\2.1.402, host version 2.1.4, commit 85255dde3e, SDKs installed 2.1.4 runtimes installed: aspnetcore.all 2.1.4, aspnetcore.app 2.1.4, .netcore.app 2.1.4

I had the same problem with the red flame mentioned above about 1 week ago. I uninstalled omnisharp and also deleted references to it on the file system, then reinstalled it. That seemed to fix it.

YangHanlin commented 6 years ago

@jtsom I have checked and found no such extension. But I found this problem in C++ development, so the same may not be true with yours.

weinand commented 6 years ago

I accidentally broke the legacy command based mechanism (adapterExecutableCommand) to get the debug adapter executable from the corresponding debugger extension. The fix will be available in tomorrows Insiders. Sorry for this.

Funny enough avoids an installed LiveShare extension the problem because it uses an alternative (and not broken) approach for the adapterExecutableCommand.

antonio-petricca commented 6 years ago

I encoured the same problem.

weinand commented 6 years ago

C++ and C# debugging works again in the latest Insiders.

antonio-petricca commented 6 years ago

It works for me too, thank you!

YangHanlin commented 6 years ago

It works for me as well. Thanks!