microsoft / microsoft/vscode

Build: vscode-reh-web-linux-x64-min throws Mangler and esbuild pipeline errors

Open
#328,113 0 comments 1 reaction 1 assignee Claimed by @bryanchen-d View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

Does this issue occur when all extensions are disabled?: Yes

- VS Code Version: 1.131.0
- OS Version: Ubuntu 2404

### Description

When attempting to run the minified Remote Extension Host build (`vscode-reh-web-linux-x64-min`) against HEAD, the build pipeline crashes.

### Steps to Reproduce

1. Clone at head and run `npm install`
2. Attempt to build the minified Remote Host Distribution with `npm run gulp vscode-reh-web-linux-x64-min`

### Root Cause

There are two separate failures that are surfaced during the build:

#### 1. The TS Compiler crashes during the Mangler phase (34 Errors)

Recent feature merges ([XaaAuthProvider](https://github.com/microsoft/vscode/commit/2d95154af0f50db2a41ceee431acfc6d79638aab), [ClaudeAgent](https://github.com/microsoft/vscode/commit/b10844efce8944e714285044e08994903a0124d1), [runInTerminalConfirmationTool](https://github.com/microsoft/vscode/commit/8c65bb17ebf7f8d359b3178ed6746d8ae7586407)) use coding patterns that conflict with the property-mangler's boundaries (Mixin inheritance, string-index access on private variables, and dynamic import destructing, respectively).

Error Output:
```
[13:02:46] src/vs/platform/agentHost/test/node/claudeAgent.test.ts(3687,19): Element implicitly has an 'any' type because expression of type
'"_sessions"' can't be used to index type '$Pfd'.
[13:02:48] src/vs/workbench/api/common/extHostXaaAuthProvider.ts(83,21): Property 'a' in type 'XaaAuthenticationProvider' is not assignable to the same property in base type '$Cvd'.
```

### 2. esbuild fails the Unicode optimizer checks

The [outputMonitor.ts](https://github.com/microsoft/vscode/blob/main/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.ts) file [recently introduced](https://github.com/microsoft/vscode/commit/6707517391c9708409d362d3e45ed8897a5f37bf) naked non-ASCII terminal prompt characters into a RegExp literal, which triggers a fatal assertion in build/lib/optimize.ts

Error Output:
```
[13:52:38] Error: Found non-ascii character ›❯▸▶ in the minified output of out-vscode-reh-web/.../workbench.js.
Non-ASCII characters in the output can cause performance problems when loading. Please review if you have introduced a regular expression that esbuild is not automatically converting and convert it to using unicode escape sequences.
```
### Proposed Fix

We have fixed these breakages locally by introducing the following 6 small, localized patches to bypass the mangler logic constraints and esbuild checks:
1. **Dynamic Imports**: Added /** @skipMangle */ to ConfirmTerminalCommandTool and ScriptedMockAgent
2. **String Indexing**: Cast the test instances to .agent as any before performing the string-index lookups (_sessions, _keybindingService) in claudeAgent.test.ts and terminalInstance.test.ts.
3. **Mixin Inheritance**: Converted the private internal state on the Mixin XaaAuthenticationProvider to public to bypass property mangling collisions.
4. **Unicode Strings**: Translated the raw terminal chevron characters [›❯▸▶] to their unicode escape-sequences [\u203A\u276F\u25B8\u25B6] in outputMonitor.ts.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.