"TypeError: Cannot read property 'then' of undefined" using 8.0.0-next.12 with latest VS Code stable
See original GitHub issue@dbaeumer I’m not sure whether this is expected to work yet (using 8.0.0-next.12 from npm with the newly published VS Code stable), but I’m seeing this issue when my server calls showMessage
:
[12:39:38 PM] [CI] [Error] TypeError: Cannot read property 'then' of undefined
at LanguageClient.showNotificationMessage ([/Users/danny/Dev/Dart-Code/node_modules/vscode-languageclient/lib/common/client.js:2256:1]())
at LanguageClient.error ([/Users/danny/Dev/Dart-Code/node_modules/vscode-languageclient/lib/common/client.js:2246:1]())
at LanguageClient.handleFailedRequest ([/Users/danny/Dev/Dart-Code/node_modules/vscode-languageclient/lib/common/client.js:2948:1]())
at [/Users/danny/Dev/Dart-Code/node_modules/vscode-languageclient/lib/common/client.js:1917:1]()
If I put a breakpoint, it seems that the call to messageFunc
is returning undefined
but a Promise
is assumed (it’s taking the error path):
(why showMessage is being called here with an error is another issue I need to investigate, but this feels like an issue on its own).
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Cannot read property 'then' of undefined · Issue #49400 - GitHub
Issue Id: 05d7571c-75cf-7c3f-1c01-05ad709135ca. Versions - 1.23.0 - b8475d1. Stack TypeError: Cannot read property 'then' of undefined
Read more >Resolving the JavaScript Promise Error "TypeError: Cannot ...
TypeError : Cannot read property 'then' of undefined. In this guide, we will cover two code examples containing a bugs that cause this ......
Read more >TypeError: Cannot read property 'then' of undefined
It is probably that your islogged method not returning a value in some case. After that I see that you are NOT using...
Read more >[webpack-cli] typeerror: cannot read properties of undefined ...
I am new to Vue js and faced with the following problem: When trying to launch a project, an error occurs: Cannot read...
Read more >Visual Studio Code Frequently Asked Questions
Visual Studio Code FAQ. Our docs contain a Common questions section as needed for specific topics. We've captured items here that don't fit...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Let me know what the outcome is. The
messageFunc
should point to existing VS Code API.Actually, this has always been this way - but before it was just an Information message and the test missed it. Most of the errors handled by this are actually prevented earlier by validation before we send the request, so I’ll just amend the test to handle it. There is no regression here (only a change in the severity of the error message shown by the LSP client).
(Sorry for another misfire 😬)