Skip to content

TypeError: Cannot read property 'lt' of undefined #1251

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

Closed
chalbardier opened this issue Feb 25, 2021 · 7 comments
Closed

TypeError: Cannot read property 'lt' of undefined #1251

chalbardier opened this issue Feb 25, 2021 · 7 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@chalbardier
Copy link

Issue Type: Bug

After typing in the code:

package main

import "fmt"

func main() {
fmt.Println("Hello World!")
}

I try saving it to the folder I have opened and it keeps giving me an error even though an error isn't present. The error I am getting is "Error: TypeError: Cannot read property 'lt' of undefined. I have already tried uninstalling and reinstalling the extension Go but the error remains.

Extension version: 0.22.1
VS Code version: Code 1.53.2 (622cb03f7e070a9670c94bae1a45d78d7181fbd4, 2021-02-11T11:48:04.245Z)
OS version: Windows_NT x64 10.0.19041

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz (8 x 1992)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: enabled
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.82GB (7.67GB free)
Process Argv
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstry244:30256636
pythonvsdeb440:30248342
pythonvsded773:30248341
pythonvspyt875:30259475
dockersubset:30262999
pythontb:30260843

@hyangah
Copy link
Contributor

hyangah commented Feb 25, 2021

Thanks for the report. @chalbardier
Maybe the extension couldn't find the go command and it tickled a bug in the extension.

  • Did you install go (not the extension, but go compiler e.g. golang.org/dl)?
  • Can you share exception stack trace either in the Extension Host log channel or Developer Console?

Extension log channel: Cmd+Shift+P (command pallette) -> "View: Toggle Output" -> Select "Log (Extension Host)" channel

Developer console: Cmd+Shift+P (command pallette) -> "Delveloper: Toggle Developer Tools" -> Console

@hyangah hyangah added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Feb 25, 2021
@hyangah hyangah changed the title Error Message TypeError: Cannot read property 'lt' of undefined Feb 25, 2021
@chalbardier
Copy link
Author

Hello,

Thank you for responding! Yes I did install the compiler and made sure it was installed by checking in Command Prompt. This is what is in the extension log channel:

[2021-02-25 15:13:46.434] [exthost] [info] extension host started
[2021-02-25 15:13:46.460] [exthost] [info] ExtensionService#_doActivateExtension vscode.microsoft-authentication {"startup":false,"extensionId":{"value":"vscode.microsoft-authentication","_lower":"vscode.microsoft-authentication"},"activationEvent":"onAuthenticationRequest:microsoft"}
[2021-02-25 15:13:46.461] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/microsoft-authentication/dist/extension.js
[2021-02-25 15:13:46.475] [exthost] [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch {"startup":true,"extensionId":{"value":"vscode.debug-auto-launch","_lower":"vscode.debug-auto-launch"},"activationEvent":""}
[2021-02-25 15:13:46.475] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/debug-auto-launch/dist/extension
[2021-02-25 15:13:46.478] [exthost] [info] ExtensionService#_doActivateExtension vscode.git {"startup":true,"extensionId":{"value":"vscode.github","_lower":"vscode.github"},"activationEvent":"
"}
[2021-02-25 15:13:46.478] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/git/dist/main
[2021-02-25 15:13:46.569] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode.js-debug {"startup":false,"extensionId":{"value":"ms-vscode.js-debug","_lower":"ms-vscode.js-debug"},"activationEvent":"onCommand:extension.js-debug.clearAutoAttachVariables"}
[2021-02-25 15:13:46.569] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/ms-vscode.js-debug/src/extension.js
[2021-02-25 15:13:46.734] [exthost] [info] ExtensionService#_doActivateExtension vscode.github-authentication {"startup":false,"extensionId":{"value":"vscode.github-authentication","_lower":"vscode.github-authentication"},"activationEvent":"onAuthenticationRequest:github"}
[2021-02-25 15:13:46.734] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/github-authentication/dist/extension.js
[2021-02-25 15:13:46.773] [exthost] [info] ExtensionService#_doActivateExtension vscode.github {"startup":true,"extensionId":{"value":"vscode.github","_lower":"vscode.github"},"activationEvent":""}
[2021-02-25 15:13:46.773] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/github/dist/extension.js
[2021-02-25 15:13:46.780] [exthost] [info] eager extensions activated
[2021-02-25 15:13:46.781] [exthost] [info] ExtensionService#_doActivateExtension vscode.emmet {"startup":false,"extensionId":{"value":"vscode.emmet","_lower":"vscode.emmet"},"activationEvent":"onStartupFinished"}
[2021-02-25 15:13:46.781] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/emmet/dist/node/emmetNodeMain
[2021-02-25 15:13:46.792] [exthost] [info] ExtensionService#_doActivateExtension vscode.merge-conflict {"startup":false,"extensionId":{"value":"vscode.merge-conflict","_lower":"vscode.merge-conflict"},"activationEvent":"onStartupFinished"}
[2021-02-25 15:13:46.792] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/merge-conflict/dist/mergeConflictMain
[2021-02-25 15:13:46.796] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-wsl-recommender {"startup":false,"extensionId":{"value":"ms-vscode-remote.remote-wsl-recommender","_lower":"ms-vscode-remote.remote-wsl-recommender"},"activationEvent":"onStartupFinished"}
[2021-02-25 15:13:46.796] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/ms-vscode-remote.remote-wsl-recommender/dist/extension.js
[2021-02-25 15:13:46.811] [exthost] [info] ExtensionService#_doActivateExtension vscode.testing-editor-contributions {"startup":false,"extensionId":{"value":"vscode.testing-editor-contributions","_lower":"vscode.testing-editor-contributions"},"activationEvent":"onStartupFinished"}
[2021-02-25 15:13:46.811] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/testing-editor-contributions/dist/extension.js
[2021-02-25 15:23:02.111] [exthost] [info] extension host terminating: received terminate message from renderer
[2021-02-25 15:23:03.126] [exthost] [info] exiting with code 0
[2021-02-25 15:23:03.345] [exthost] [info] extension host started
[2021-02-25 15:23:03.370] [exthost] [info] ExtensionService#_doActivateExtension vscode.microsoft-authentication {"startup":false,"extensionId":{"value":"vscode.microsoft-authentication","_lower":"vscode.microsoft-authentication"},"activationEvent":"onAuthenticationRequest:microsoft"}
[2021-02-25 15:23:03.370] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/microsoft-authentication/dist/extension.js
[2021-02-25 15:23:03.377] [exthost] [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch {"startup":true,"extensionId":{"value":"vscode.debug-auto-launch","_lower":"vscode.debug-auto-launch"},"activationEvent":"
"}
[2021-02-25 15:23:03.377] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/debug-auto-launch/dist/extension
[2021-02-25 15:23:03.379] [exthost] [info] ExtensionService#_doActivateExtension vscode.git {"startup":true,"extensionId":{"value":"vscode.github","_lower":"vscode.github"},"activationEvent":""}
[2021-02-25 15:23:03.379] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/git/dist/main
[2021-02-25 15:23:03.439] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode.js-debug {"startup":false,"extensionId":{"value":"ms-vscode.js-debug","_lower":"ms-vscode.js-debug"},"activationEvent":"onCommand:extension.js-debug.clearAutoAttachVariables"}
[2021-02-25 15:23:03.439] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/ms-vscode.js-debug/src/extension.js
[2021-02-25 15:23:03.515] [exthost] [info] ExtensionService#_doActivateExtension vscode.github-authentication {"startup":false,"extensionId":{"value":"vscode.github-authentication","_lower":"vscode.github-authentication"},"activationEvent":"onAuthenticationRequest:github"}
[2021-02-25 15:23:03.515] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/github-authentication/dist/extension.js
[2021-02-25 15:23:03.552] [exthost] [info] ExtensionService#_doActivateExtension vscode.github {"startup":true,"extensionId":{"value":"vscode.github","_lower":"vscode.github"},"activationEvent":"
"}
[2021-02-25 15:23:03.553] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/github/dist/extension.js
[2021-02-25 15:23:03.557] [exthost] [info] eager extensions activated
[2021-02-25 15:23:03.558] [exthost] [info] ExtensionService#_doActivateExtension vscode.emmet {"startup":false,"extensionId":{"value":"vscode.emmet","_lower":"vscode.emmet"},"activationEvent":"onStartupFinished"}
[2021-02-25 15:23:03.558] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/emmet/dist/node/emmetNodeMain
[2021-02-25 15:23:03.562] [exthost] [info] ExtensionService#_doActivateExtension vscode.merge-conflict {"startup":false,"extensionId":{"value":"vscode.merge-conflict","_lower":"vscode.merge-conflict"},"activationEvent":"onStartupFinished"}
[2021-02-25 15:23:03.562] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/merge-conflict/dist/mergeConflictMain
[2021-02-25 15:23:03.566] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-wsl-recommender {"startup":false,"extensionId":{"value":"ms-vscode-remote.remote-wsl-recommender","_lower":"ms-vscode-remote.remote-wsl-recommender"},"activationEvent":"onStartupFinished"}
[2021-02-25 15:23:03.566] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/ms-vscode-remote.remote-wsl-recommender/dist/extension.js
[2021-02-25 15:23:03.573] [exthost] [info] ExtensionService#_doActivateExtension vscode.testing-editor-contributions {"startup":false,"extensionId":{"value":"vscode.testing-editor-contributions","_lower":"vscode.testing-editor-contributions"},"activationEvent":"onStartupFinished"}
[2021-02-25 15:23:03.573] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/testing-editor-contributions/dist/extension.js
[2021-02-25 15:24:23.818] [exthost] [info] ExtensionService#_doActivateExtension golang.go {"startup":false,"extensionId":{"value":"golang.go","_lower":"golang.go"},"activationEvent":"onLanguage:go"}
[2021-02-25 15:24:23.818] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/.vscode/extensions/golang.go-0.22.1/dist/goMain.js
[2021-02-25 15:36:42.022] [exthost] [info] ExtensionService#_doActivateExtension vscode.debug-server-ready {"startup":false,"extensionId":{"value":"vscode.debug-server-ready","_lower":"vscode.debug-server-ready"},"activationEvent":"onDebugResolve"}
[2021-02-25 15:36:42.022] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/debug-server-ready/dist/extension
[2021-02-25 15:36:57.789] [exthost] [info] ExtensionService#_doActivateExtension vscode.grunt {"startup":false,"extensionId":{"value":"vscode.grunt","_lower":"vscode.grunt"},"activationEvent":"onCommand:workbench.action.tasks.runTask"}
[2021-02-25 15:36:57.789] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/grunt/dist/main
[2021-02-25 15:36:57.795] [exthost] [info] ExtensionService#_doActivateExtension vscode.gulp {"startup":false,"extensionId":{"value":"vscode.gulp","_lower":"vscode.gulp"},"activationEvent":"onCommand:workbench.action.tasks.runTask"}
[2021-02-25 15:36:57.796] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/gulp/dist/main
[2021-02-25 15:36:57.799] [exthost] [info] ExtensionService#_doActivateExtension vscode.jake {"startup":false,"extensionId":{"value":"vscode.jake","_lower":"vscode.jake"},"activationEvent":"onCommand:workbench.action.tasks.runTask"}
[2021-02-25 15:36:57.799] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/jake/dist/main
[2021-02-25 15:36:57.803] [exthost] [info] ExtensionService#_doActivateExtension vscode.npm {"startup":false,"extensionId":{"value":"vscode.npm","_lower":"vscode.npm"},"activationEvent":"onCommand:workbench.action.tasks.runTask"}
[2021-02-25 15:36:57.803] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/npm/dist/npmMain
[2021-02-25 15:36:57.826] [exthost] [info] ExtensionService#_doActivateExtension vscode.typescript-language-features {"startup":false,"extensionId":{"value":"vscode.typescript-language-features","_lower":"vscode.typescript-language-features"},"activationEvent":"onCommand:workbench.action.tasks.runTask"}
[2021-02-25 15:36:57.826] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Corinne Halbardier/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/typescript-language-features/dist/extension

@hyangah
Copy link
Contributor

hyangah commented Feb 25, 2021

@chalbardier I don't see any exception stack trace. Is the developer tool console or other channels from the Output pane clean? The exception trace should include the same error message "TypeError: Cannot read property 'lt' of undefined"

@chalbardier
Copy link
Author

@hyangah I do see it talking about the error in the Developer Console. This is the information it is giving me:

Developer Console Data.txt

@hyangah
Copy link
Contributor

hyangah commented Feb 26, 2021

Thanks! The log was helpful and found the place we are missing additional checks (code

But, the root cause here is that the extension couldn't find go. Wasn't there any notification/prompt about missing Go installation?

The Path the extension sees are

C:\Program Files (x86)\Google\Chrome\Application;C:\Program Files\Amazon Corretto\jdk1.8.0_265\bin;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files (x86)\Gpg4win..\GnuPG\bin;C:\Users\Corinne Halbardier\AppData\Local\Microsoft\WindowsApps;

I don't see Go installation path there yet. Did you install Go using the official Go installer and try to restart VSCode?

I also filed #1252 which will be fixed in the next release and help users who didn't configure the Path yet. Please check the Path and verify the directory for Go exists in the Path. Then, restart VS Code.

If that doesn't work, a temporary workaround is to add this in the settings.

"go.alternateTools": {
   "go": "<path to your go binary>"
}

@chalbardier
Copy link
Author

Thank you for looking it over! There was not a notification that said anything about missing Go. I did install the official Go installer and I have tried restarting VSCode. However, when I installed Go it did not give me the option to assign it directly in the Path. I have already tried deleting it and reinstalling it. I am not too familiar with programming so I'm not sure where to put the code you gave me but I will reach out to some of my associates tomorrow to see if they are able to show me how to fix it with your advice. Thank you so much for all your time and help!

@gopherbot
Copy link
Collaborator

Change https://golang.org/cl/297132 mentions this issue: src/goModules: check goVersion isn't null before using it

@hyangah hyangah added this to the v0.23.0 milestone Mar 2, 2021
@golang golang locked and limited conversation to collaborators Mar 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants