vscode: "Cannot read property 'adapter' of undefined"
I saw this previously in #66322 in provideCodeActions which was fixed, but I’ve just seen the same thing on stable in provideDocumentSymbols:
ERR Cannot read property 'adapter' of undefined: TypeError: Cannot read property 'adapter' of undefined
at e._withAdapter (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:553:140)
at e.$provideDocumentSymbols (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:554:184)
at t._doInvokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:644:118)
at t._invokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:643:744)
at t._receiveRequest (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:642:256)
at t._receiveOneMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:641:155)
at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:638:960
at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:38:994
at e.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:44:113)
at a (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:170:213)
at Socket.f._socketDataListener (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:170:434)
at Socket.emit (events.js:182:13)
at addChunk (_stream_readable.js:279:12)
at readableAddChunk (_stream_readable.js:264:11)
at Socket.Readable.push (_stream_readable.js:219:10)
at Pipe.onread (net.js:636:20)
I guess it should have the same fix (and based on the comments in that issue, Hovers may also need it?).
I was more aware of what I was doing to repro it this time… The Dart extension has code to restart itself when certain config changes (for example, the path to the Dart SDK). We run through all of the providers we created and dispose them, and then re-create them using the new SDK server client.
Based on @jrieken’s comment at https://github.com/Microsoft/vscode/issues/66322#issuecomment-453110213 I guess that if this happens while there are outstanding requests, this error could occur.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 19 (18 by maintainers)
Commits related to this issue
- make sure outline requests are cancelled when changing providers, #69147 — committed to microsoft/vscode by jrieken 5 years ago
- Revert "make sure outline requests are cancelled when changing providers, #69147" This reverts commit bfe5b4c92c18b0be8e492b836bbbb45ca0571d4e. This fixes #69657 — committed to microsoft/vscode by jrieken 5 years ago
- cancel requests when outline provider change, also retrigger request #69147 — committed to microsoft/vscode by jrieken 5 years ago
- Work on making sure code action requests are canceled when providers change Part of #69147 — committed to microsoft/vscode by mjbvz 5 years ago
- Add fallback values for when exthost adapter cannot be found Fixes #69147 Due to the asynchronous communication between the exthost and main process, there may be cases where we request data from a ... — committed to mjbvz/vscode by mjbvz 5 years ago
The “no adapter found” message from Code Actions is the only error I seem to be able to repro today in Insiders. I’ll do some more testing once that’s fixed to see if I can find any more. Thanks!
(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like: