Skip to content

Cannot build working VSIX from WSL2 - native binaries mismatch #9326

@shanevcantwell

Description

@shanevcantwell

Problem

When building the VS Code extension VSIX from WSL2, the resulting extension fails to activate with:

Error: \\?\c:\Users\...\node_sqlite3.node is not a valid Win32 application

Root Cause

The VS Code extension host runs on Windows even when connected to a WSL remote workspace. However, building the VSIX on Linux produces Linux-only native binaries (sqlite3, LanceDB, ripgrep).

The prepackage script defaults to the current platform:

[info] Using target: linux-x64

Attempted Solutions

  1. --target win32-x64 - Fails because Windows dependencies (rg.exe) aren't available on Linux:

    Error: The following files were missing:
    - node_modules/@vscode/ripgrep/bin/rg.exe
    
  2. Environment variable CONTINUE_VSCODE_TARGET=win32-x64 - Same issue

Impact

Developers using WSL2 (a common setup) cannot:

  • Build and test local VSIX changes
  • Iterate on native module-dependent features
  • Verify fixes before submitting PRs

Suggested Solutions

  1. Cross-platform VSIX builds - Download pre-built Windows binaries during Linux builds when targeting win32
  2. Documentation - Document that WSL2 developers must use marketplace version or build on native Windows
  3. Universal binaries - Include all platform binaries in the VSIX (larger but always works)

Environment

  • WSL2 Ubuntu on Windows 11
  • VS Code with Remote - WSL extension
  • Node.js v22.17.0

Related

This was discovered while working on PR #9325 (WSL2 terminal command fix).

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:buildRelates to building extensions from sourcedependenciesPull requests that update a dependency fileide:vscodeRelates specifically to VS Code extensionkind:bugIndicates an unexpected problem or unintended behavioros:windowsHappening specifically on Windows

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions