vscode-zig icon indicating copy to clipboard operation
vscode-zig copied to clipboard

Error loading when "zig.version" is not manually defined

Open loyc12 opened this issue 6 months ago • 1 comments

Using VScode 1.99.3, ZLS 0.14.0, Zig 1.14.1, and Ubuntu 24.04.2 LTS

This looks like a classing Object:Object issue, but I have no clue as to how to reproduce it on someone else's machine, or go about fixing it.

VScode "Extension Host" Logs :

[error] Activating extension ziglang.vscode-zig failed due to an error: 2025-06-27 19:11:46.625 [error] TypeError: Invalid version. Must be a string. Got type "object". at new c (/home/UserName/.vscode/extensions/ziglang.vscode-zig-0.6.10/out/extension.js:21:25816) at kM (/home/UserName/.vscode/extensions/ziglang.vscode-zig-0.6.10/out/extension.js:23:14569) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async cc (/home/UserName/.vscode/extensions/ziglang.vscode-zig-0.6.10/out/extension.js:23:13714) at async $6 (/home/UserName/.vscode/extensions/ziglang.vscode-zig-0.6.10/out/extension.js:23:23882) at async VM (/home/UserName/.vscode/extensions/ziglang.vscode-zig-0.6.10/out/extension.js:36:1711) at async cw.n (file:///snap/code/191/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:111:13359) at async cw.m (file:///snap/code/191/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:111:13322) at async cw.l (file:///snap/code/191/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:111:12778)

ZLS Logs unavailable, as reverting to previously buggy setup did not bring back the bug.

It seems setting zig.version to 1.14.1 manually once resolved this particular issue somehow.

initial report of this issue, in the zig discord server:

loyc12 avatar Jun 27 '25 23:06 loyc12

The stack trace appears to point to the following line in the extensions code: https://github.com/ziglang/vscode-zig/blob/59b1a6c3f31e7a166534c121b2ba007f05276fa9/src/zigSetup.ts#L92

This section of the code takes a non -dev version of Zig like 0.14.0 and tries to lookup the latest minor version like 0.14.1. When an exception occurred (possibly because there was no internet connection) it would try to do this lookup by using a previously cached result. The caching has a bug which may be the cause of this issue. The caching bug should be fixed by https://github.com/ziglang/vscode-zig/pull/437.

Techatrix avatar Jun 28 '25 01:06 Techatrix