Skip to content

Pre-release check crashes extension if the response is invalid #13953

@kucharski-s

Description

@kucharski-s

Environment

  • OS and Version: Linux
  • VS Code Version: 1.99.3
  • C/C++ Extension Version: 1.27.7
  • If using SSH remote, specify OS of remote machine: N/A

Bug Summary and Steps to Reproduce

Bug Summary:

The extension crashes with following error when reply from the server is invalid. Such situation can occur when held by a captive portal.

In our setup DNS is intercepted due to security restrictions and redirects to our server (like a captive portal would). This causes the extension gallery POST request get a 404 response with an HTML page.

2025-09-20 16:55:28.879 [error] TypeError: Cannot read properties of undefined (reading '0')
at Object.preReleaseCheck (/home/team/.vscode/extensions/ms-vscode.cpptools-1.27.7-linux-x64/dist/src/main.js:11970:50)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async activate (/home/team/.vscode/extensions/ms-vscode.cpptools-1.27.7-linux-x64/dist/src/main.js:117216:9)
at async cw.n (file:///usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:111:13359)
at async cw.m (file:///usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:111:13322)
at async cw.l (file:///usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:111:12778)

This is the relevant line:

await LanguageServer.preReleaseCheck();

Steps to reproduce:

  1. Run VS Code on machine with restricted Internet access.
  2. Observe that the extension crashes.

Expected behavior:
The extension handles the error gracefully, as if no Internet was present.

Configuration and Logs

2025-09-20 16:55:28.879 [error] TypeError: Cannot read properties of undefined (reading '0')
        at Object.preReleaseCheck (/home/team/.vscode/extensions/ms-vscode.cpptools-1.27.7-linux-x64/dist/src/main.js:11970:50)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        at async activate (/home/team/.vscode/extensions/ms-vscode.cpptools-1.27.7-linux-x64/dist/src/main.js:117216:9)
        at async cw.n (file:///usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:111:13359)
        at async cw.m (file:///usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:111:13322)
        at async cw.l (file:///usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:111:12778)

Other Extensions

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

Language ServicebugfixedCheck the Milestone for the release in which the fix is or will be available.

Type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions