"cannot resolve 'vscode'" after adding @theia/languages to extension deps

After adding "@theia/languages": "latest" to my extension’s dependencies, I get the following error during build:

ERROR in ../node_modules/vscode-languageclient/lib/typeDefinition.js
Module not found: Error: Can't resolve 'vscode' in '/home/ben/Projects/theia-static-web/node_modules/vscode-languageclient/lib'
 @ ../node_modules/vscode-languageclient/lib/typeDefinition.js 7:17-34
 @ ../node_modules/monaco-languageclient/lib/monaco-language-client.js
 @ ../node_modules/monaco-languageclient/lib/index.js
 @ ../node_modules/@theia/languages/lib/browser/language-client-services.js
 @ ../node_modules/@theia/languages/lib/browser/language-resource-context-key.js
 @ ../node_modules/@theia/languages/lib/browser/languages-frontend-module.js
 @ ./src-gen/frontend/index.js

Any ideas what’s causing this? I’ve tried adding vscode to my package deps (dev and prod) but that doesn’t fix the error.

@bendavis the @theia/languages extension is deprecated since 1.4.0 and should no longer be used.

Ah, thanks!

1 Like