Skip to content

Command execution broken in v0.46: TypeError: Cannot read properties of null (reading 'Token'). #3698

Closed
@NoahELE

Description

@NoahELE

What version of Go, VS Code & VS Code Go extension are you using?

Version Information
  • Run go version to get version of Go from the VS Code integrated terminal.
    • go version go1.24.0 windows/amd64
  • Run gopls -v version to get version of Gopls from the VS Code integrated terminal.
    • golang.org/x/tools/gopls v0.18.1
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.
    • 1.97.2 e54c774e0add60467559eb0d1e229c6452cf8447 x64
  • Check your installed extensions to get the version of the VS Code Go extension
    • 0.46.0
  • Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > Go: Locate Configured Go Tools command.

Tools Configuration

Environment

GOBIN: undefined
toolsGopath:
gopath: C:\Users\admin\go
GOROOT: C:\Program Files\Go
PATH: C:\Program Files\PowerShell\7;C:\Windows;C:\Windows\System32;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)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files\NVIDIA Corporation\NVIDIA app\NvDLISR;C:\Program Files\PowerShell\7;C:\Program Files\Go\bin;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Users\admin\AppData\Local\Programs\Python\Launcher;C:\Users\admin\AppData\Local\Programs\Python\Python313;C:\Users\admin\AppData\Local\Programs\Python\Python313\Scripts;C:\Users\admin\AppData\Local\Programs\Python\Launcher;C:\Users\admin\AppData\Roaming\npm;C:\Users\admin\AppData\Local\Coursier\data\bin;C:\Users\admin\scoop\apps\mingw\current\bin;C:\Users\admin\scoop\apps\llvm\current\bin;C:\Users\admin\scoop\apps\openssl\current\bin;C:\Users\admin\scoop\shims;C:\Users\admin.local\bin;C:\Users\admin.cargo\bin;C:\Users\admin\go\bin;C:\Users\admin\JDK\graalvm-jdk-21.0.6+8.1\bin;C:\Users\admin\Maven\apache-maven-3.9.9\bin;C:\Users\admin\Gradle\gradle-8.12.1\bin;D:\Software\Microsoft VS Code\bin;D:\Software\OneCommander;D:\Software\SumatraPDF;C:\Users\admin\AppData\Local\Microsoft\WindowsApps;

Tools

go:	C:\Program Files\Go\bin\go.exe: go version go1.24.0 windows/amd64

gopls:	C:\Users\admin\go\bin\gopls.exe	(version: v0.18.1 built with go: go1.24.0)
gotests:	C:\Users\admin\go\bin\gotests.exe	(version: v1.6.0 built with go: go1.24.0)
gomodifytags:	C:\Users\admin\go\bin\gomodifytags.exe	(version: v1.17.0 built with go: go1.24.0)
impl:	C:\Users\admin\go\bin\impl.exe	(version: v1.4.0 built with go: go1.24.0)
goplay:	C:\Users\admin\go\bin\goplay.exe	(version: v1.0.0 built with go: go1.24.0)
dlv:	C:\Users\admin\go\bin\dlv.exe	(version: v1.24.0 built with go: go1.24.0)
golangci-lint:	C:\Users\admin\go\bin\golangci-lint.exe	(version: v1.64.5 built with go: go1.24.0)

Go env

Workspace Folder (grpc-demo): d:\Code\grpc-demo

set AR=ar
set CC=gcc
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_ENABLED=1
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set CXX=g++
set GCCGO=gccgo
set GO111MODULE=
set GOAMD64=v1
set GOARCH=amd64
set GOAUTH=netrc
set GOBIN=
set GOCACHE=C:\Users\admin\AppData\Local\go-build
set GOCACHEPROG=
set GODEBUG=
set GOENV=C:\Users\admin\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFIPS140=off
set GOFLAGS=
set GOGCCFLAGS=-m64 -mthreads -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\admin\AppData\Local\Temp\go-build1367654372=/tmp/go-build -gno-record-gcc-switches
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMOD=d:\Code\grpc-demo\go.mod
set GOMODCACHE=C:\Users\admin\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\admin\go
set GOPRIVATE=
set GOPROXY=https://goproxy.io,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTELEMETRY=local
set GOTELEMETRYDIR=C:\Users\admin\AppData\Roaming\go\telemetry
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.24.0
set GOWORK=
set PKG_CONFIG=pkg-config

Share the Go related settings you have added/edited

  "[go]": {
    "editor.insertSpaces": false
  },
  "go.inlayHints.assignVariableTypes": true,
  "go.inlayHints.compositeLiteralFields": true,
  "go.inlayHints.compositeLiteralTypes": true,
  "go.inlayHints.constantValues": true,
  "go.inlayHints.functionTypeParameters": true,
  "go.inlayHints.parameterNames": true,
  "go.inlayHints.rangeVariableTypes": true,
  "go.lintTool": "golangci-lint",
  "go.toolsManagement.autoUpdate": true,
  "gopls": {
    "formatting.gofumpt": true,
    "ui.semanticTokens": true
  },

Describe the bug

Click the commands in go.mod like Check for upgrades, etc. causes an error of Command 'gopls.check_upgrades' failed: TypeError: Cannot read properties of null (reading 'Token').

Steps to reproduce the behavior:

  1. Go to go.mod in a go project
  2. Click on 'Check for upgrades'
  3. See error

Screenshots or recordings

Image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions