Cannot build working VSIX from WSL2 - native binaries mismatch
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
-
--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 -
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
- Cross-platform VSIX builds - Download pre-built Windows binaries during Linux builds when targeting win32
- Documentation - Document that WSL2 developers must use marketplace version or build on native Windows
- 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
Related Issues
Found several related issues about building, native binaries, and platform mismatches:
Native binary/platform issues:
- #7853 - Continue v1.3.10-vscode win32-x64 published with corrupted esbuild.exe
- #7330 - Wrong lancedb arch version installed on macos ARM
- #3618 - Error: EPERM: operation not permitted, unlink node_sqlite3.node (Windows build issue)
WSL-specific issues:
- #3764 - Unable to debug the extension from WSL Remote (fork on main)
- #6140 - Unable to build the vscode or intellij locally to customize for our need
Build/extension issues:
- #8386 - .vsix extension don't work
- #3594 - ERROR: npm run esbuild
These issues share common themes around cross-platform builds, native module dependencies (sqlite3, lancedb, esbuild, ripgrep), and WSL/Windows development challenges.
Workaround Found
For WSL2 developers who need to test local VSIX builds:
- Build the VSIX on Linux (as normal)
- Install the VSIX:
code --install-extension path/to/continue.vsix - Delete the Windows-side installation:
rm -rf /mnt/c/Users/<username>/.vscode/extensions/continue.continue-* - Reload VS Code
This forces VS Code to run Continue exclusively in the WSL extension host, where Linux native binaries work correctly. The extension's extensionKind: ["ui", "workspace"] allows it to run in either host.
Why it works: The activation error occurs when the Windows extension host tries to load Linux .node binaries. By removing the Windows installation, VS Code falls back to the WSL extension host only.
Limitation: This workaround may affect scenarios where the extension needs to run UI-side operations on Windows. Testing so far shows normal functionality in WSL remote workspaces.
This issue hasn't been updated in 90 days and will be closed after an additional 10 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue.
This issue was closed because it wasn't updated for 10 days after being marked stale. If it's still important, please reopen + comment and we'll gladly take another look!