Skip to content
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

debug: unhandled promise rejection error #982

Closed
hyangah opened this issue Dec 1, 2020 · 3 comments
Closed

debug: unhandled promise rejection error #982

hyangah opened this issue Dec 1, 2020 · 3 comments
Assignees
Labels
Debug Issues related to the debugging functionality of the extension. FrozenDueToAge
Milestone

Comments

@hyangah
Copy link
Contributor

hyangah commented Dec 1, 2020

Reported by a user in the gopher slack

Extension version: v0.19.0

(node:77378) UnhandledPromiseRejectionWarning: TypeError: Cannot read property ~/be_game_platform' of undefined
    at Delve.<anonymous> (/Users/admin/.vim/plugged/vimspector/gadgets/macos/download/vscode-go/0.19.0/root/extension/dist/debugAdapter.js:24441:85)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/admin/.vim/plugged/vimspector/gadgets/macos/download/vscode-go/0.19.0/root/extension/dist/debugAdapter.js:24139:58)
(node:77378) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:77378) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. (edited) 

The rejection was caused by the code

} else if (currentGOWorkspace && !launchArgs.packagePathToGoModPathMap[dirname]) {

For some reason that I don't understand, we probably ended up with undefined launchArgs.packagePathToGoModPAthMap. Check how this happened, and also make the code path more robust.

/cc @quoctruong @suzmue

@hyangah hyangah added the Debug Issues related to the debugging functionality of the extension. label Dec 1, 2020
@hyangah hyangah added this to the v0.19.1 milestone Dec 1, 2020
@suzmue suzmue self-assigned this Dec 1, 2020
@gopherbot
Copy link
Collaborator

Change https://golang.org/cl/274932 mentions this issue: src/goDebug: check for undefined launchArgs.packagePathToGoModMap

gopherbot pushed a commit that referenced this issue Dec 2, 2020
Add a sanity check that launchArgs.packagePathToGoModPathMap is not
undefined.

Updates #982

Change-Id: Id7470268c6beaf3e7656e16a1d07fb7ea6d80cca
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/274932
Trust: Suzy Mueller <[email protected]>
Run-TryBot: Suzy Mueller <[email protected]>
TryBot-Result: kokoro <[email protected]>
Reviewed-by: Quoc Truong <[email protected]>
@suzmue
Copy link
Contributor

suzmue commented Dec 2, 2020

I was unable to reproduce this and unsure what could be causing packagePathToGoModMap to be undefined. We added a check so it will not crash if this happens.

If you encounter this error again, please comment on this issue with information about your debugging setup!

@suzmue suzmue closed this as completed Dec 2, 2020
@gopherbot
Copy link
Collaborator

Change https://golang.org/cl/276215 mentions this issue: [release] src/goDebug: check for undefined launchArgs.packagePathToGoModMap

gopherbot pushed a commit that referenced this issue Dec 8, 2020
…ModMap

Add a sanity check that launchArgs.packagePathToGoModPathMap is not
undefined.

Updates #982

Change-Id: Id7470268c6beaf3e7656e16a1d07fb7ea6d80cca
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/274932
Trust: Suzy Mueller <[email protected]>
Run-TryBot: Suzy Mueller <[email protected]>
TryBot-Result: kokoro <[email protected]>
Reviewed-by: Quoc Truong <[email protected]>
(cherry picked from commit 650b8ae)
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/276215
Trust: Hyang-Ah Hana Kim <[email protected]>
Run-TryBot: Hyang-Ah Hana Kim <[email protected]>
Reviewed-by: Robert Findley <[email protected]>
@golang golang locked and limited conversation to collaborators Dec 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Debug Issues related to the debugging functionality of the extension. FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

3 participants