microsoft / microsoft/vscode-extension-samples
running wasm-language-server on vscode.dev
@dbaeumer is already working on this.
Since Oct 23, 2025.
- Dominant language
- TypeScript
- Stars
- 10.2k
- Forks
- 3.9k
- PR merge metrics
- No merged PRs in 30d
Description
Extension sample
wasm-language-server
VS Code version
1.105.1
What went wrong?
When trying to run npm run esbuild as per the instructions, it results in
$ npm run esbuild
> wasm-language-server@1.0.0 esbuild
> node ./bin/esbuild.js
✘ [ERROR] Could not resolve "vscode-languageclient/node"
client/src/extension.ts:7:82:
7 │ ...geClientOptions, ServerOptions, RequestType } from 'vscode-languageclient/node';
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The path "./node" is not currently exported by package "vscode-languageclient":
Switching the import line in question from 'vscode-languageclient/node' to
import { LanguageClient, LanguageClientOptions, ServerOptions, RequestType } from 'vscode-languageclient';
gets further, allows npm run esbuild then npm serve then in the command palette install extension from location, things install. Activation seems to begin/log message 'Starting WASM based LSP server'
when a codespace from a git repository is open which seemed like some kind of necessary condition to have a workspace open.
Unfortunately activation fails with:
LSP Client client: couldn't create connection to server.
RAL@https://localhost:5000/client/dist/web/extension.js#vscode-extension:872:15
fromOptions@https://localhost:5000/client/dist/web/extension.js#vscode-extension:1428:50
ReadableStreamMessageReader@https://localhost:5000/client/dist/web/extension.js#vscode-extension:1448:53
startServer2@https://localhost:5000/client/dist/web/extension.js#vscode-extension:20366:24
serverOptions@https://localhost:5000/client/dist/web/extension.js#vscode-extension:20439:49
[Error - 5:43:09 PM] Start failed
RAL@https://localhost:5000/client/dist/web/extension.js#vscode-extension:872:15
fromOptions@https://localhost:5000/client/dist/web/extension.js#vscode-extension:1428:50
ReadableStreamMessageReader@https://localhost:5000/client/dist/web/extension.js#vscode-extension:1448:53
startServer2@https://localhost:5000/client/dist/web/extension.js#vscode-extension:20366:24
serverOptions@https://localhost:5000/client/dist/web/extension.js#vscode-extension:20439:49
Sadly, that change seems to break the local install method (within vscode run on the desktop) with the same error so while it makes it compile, it seems incorrect... Curious is anyone has managed to get that sample working on vscode.dev
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.