-
Notifications
You must be signed in to change notification settings - Fork 765
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
v0.20.0 works, v0.21.0 causes "Cannot get property 'get' of undefined" #1104
Comments
@PatrickDuncan Thanks for the report - do you mind sharing the full exception log? I guess the error message is either in the |
Oh, nevermind. I reproduced the issue. :-( How to reproduce: disable the language server, which will activate the default build/vet checks.
|
Change https://golang.org/cl/285092 mentions this issue: |
I'm encountering the same issue myself -- I might be a little dense towards the end of the day, but could you clarify if there is a workaround for this currently? EDIT: I see now, setting |
Thanks @kjbass for sharing the workaround. That's what I'd recommend - we plan to enable the language server by default next week so this is a good time to test 😅 If enabling the language server isn't an option, please try the older version (0.20.0) I will try to publish the patch as soon as it is reviewed. Sorry for the inconvenience. |
I had the same issue running on Windows 10. Went back to version v0.20.2 and is working again. |
I have this problem on OSX 11.1 Vscode version: Go extension version: I also tried adding the languageserver to my settings via the sugggested workaround and that does not work for me unfortunately: EDIT: Thanks to @BatmanAoD I was able to get rid of the error by running "Go: Install/Update Tools" and selecting all the packages and re-installing them (CMD + SHIFT + P) |
I had the same issue, I think. I also had other weird errors, such as:
After some fruitless searching (and following the troubleshooting guide), I eventually discovered that my |
Change https://golang.org/cl/285255 mentions this issue: |
goLanguageServer's languageClient can be a valid language client, but isn't started yet. So, check if the diagnostic info is available and if there is any diagnostic for the given file uri before trying to start deduping. This addresses the exception thrown when the extension tries to access the undefined diagnostics. Another issue is the buildLanguageClient currently creates a non-nill languageClient object even when the language client doesn't need to be enabled. But that change is too subtle to be included in a patch release, so we don't address here. Fixes #1104 Change-Id: Id923719462b68972a79e3f7c32f54edba7462e46 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/285092 Trust: Hyang-Ah Hana Kim <hyangah@gmail.com> Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Rebecca Stambler <rstambler@golang.org> (cherry picked from commit 7f56895) Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/285255
v0.21.1 is now released. Thank you again for reporting the issue and sharing workarounds! |
What version of Go, VS Code & VS Code Go extension are you using?
go version
to get version of Gocode -v
orcode-insiders -v
to get version of VS Code or VS Code Insidersgo env
to get the go development environment detailsShare the Go related settings you have added/edited
Default
Describe the bug
When I saw I get the
Cannot get property 'get' of undefined
, but it seems like the extension was partially doing its job still. v0.20.0 does not have the error at all.Steps to reproduce the behavior:
.go
file on macOSThe text was updated successfully, but these errors were encountered: