-
Notifications
You must be signed in to change notification settings - Fork 645
Error: TypeError: Invalid Version: undefined #2770
Comments
Are you able to see this consistently? If yes, then can you share the stack trace for this error? You can find this in one of 2 places
In case there is too much noise in these logs, you can clear them and do what is needed to replicate the issue to see the corresponding logs |
Same error. "Error: TypeError: Invalid Version: undefined" is the only thing i've got. There is no other log or more information. |
It happens after upgrading to the latest version. |
@mrpanc Did you try the output panel or the console as suggested in #2770 (comment) for more information? |
@mrpanc Are you also able to get around the error by disabling the build on save and vet on save feature like @ransombriggs ? @mrpanc, @ransombriggs Can you share the version of Go you are using? Also share any Go related settings you might have added/edited. You can get these by running the command @stamblerre This is most likely coming from the semver dependency that was added in the last release. There are 2 locations in the semver library where this error is thrown from:
Since the error is having If either @mrpanc or @ransombriggs can share the stack trace, then that would be most helpful. Meanwhile, we can start the investigation around the build & vet on save features |
Same error. here is the log:
|
@ramya-rao-a found in the developer tools
|
Awesome, thanks for the stack traces!! @lenmore, @ransombriggs Can you share the version of Go you are using? Also share any Go related settings you might have added/edited. You can get these by running the command @stamblerre Based on the above, I have narrowed it down to https://github.com/microsoft/vscode-go/blob/0.11.5/src/goModules.ts#L56 in our code and https://github.com/npm/node-semver/blob/0eeceecfba490d136eb3ccae3a8dc118a28565a0/semver.js#L647 in semver |
|
I sent a PR to add some additional testing and error handling, but I imagine that something is going wrong when we parse the user's Go version. If it fails the first time for whatever reason, we don't retry, which I suppose might be causing this error. |
I have the same issue on Ubuntu. Like @ransombriggs I can remove it by changing the on save settings for vet/build. Ubuntu:
Go Version:
Code Version:
settings.json
The log output is as follows:
|
Hey all, Can you try the latest beta version (0.11.7-beta.3) of this extension and see if the issue still persists? If the issue no longer persists, then open the console logs again and look for any logs starting with either of the below and share them please
|
@ramya-rao-a Perfect. The beta version works. Thanks so much for the speedy fix. The extension host logs have nothing related to the version now:
|
Apologies, I only checked the logs and not the console dev tools:
|
I tried the beta and I no longer get errors and I also see the following in the dev tools
|
Awesome, so looks like the cc @stamblerre |
Run into the same issue. After setting export GOPATH="$HOME/go" |
@ramya-rao-a: I think it's more likely that we are failing to find the path for the |
@stamblerre It is unlikely that we didn't find path to
|
Not sure it's related, but I'm on a fresh install and installed Go from snap for the first time. I didn't previously have any issues when I manually installed into
|
Don't think it is related because my GO Path is |
Thanks all! Can you confirm one more thing for me please?
|
Ran into this problem today and using the beta version fixed it. I also ran the steps above & can confirm it works as expected |
@ramya-rao-a I do not get the red squiggly after following the instructions |
@ramya-rao-a I do not get the red squiggly either and the editor reports no problems even when the code is broken. |
Can anyone confirm if installing go from Snap is causing it or not?
|
@ransombriggs, @tomjowitt If your |
Another way to check if the extension is able to find the Go tool or not is to run the |
The latest update (0.11.7) has the fix for this issue of
|
Thanks for the update @ramya-rao-a. On version 0.11.7:
|
I did have this problem, and after restarting Code it has now gone away. This got me thinking about what changed underneath. snap info go showed me that it had refreshed four days ago, so perhaps the remembered Go that Code has referenced internally was moved underneath it. This could probably be tested by changing the go snap to use a different release, like I'm trying this just now... 🕺 ... didn't seem to impact it. |
@Arghyadeb @ramya-rao-a I was able to fix this by uninstalling snap and following these instructions instead |
Steps to Reproduce:
Debugging
I found that if I turned off
buildOnSave
andvetOnSave
that the error goes away if that helps at all with debugging.The text was updated successfully, but these errors were encountered: