Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

312
Visualizações
After updating vscode-languageclient, my Visual Studio Code extension does not compile any more

I am developing a Visual Studio Code extension (languageserver), and it worked perfectly fine. However, in order to use the latest languageserver features, I updated the vscode-languageclient to the latest version V7.0.0

npm install vscode-languageclient

After removing both node_modules and out folders, and recompiling with

npm install
npm build
npm run compile

I get a TON of compile errors. To show just a few:

node_modules/vscode-languageclient/lib/common/callHierarchy.d.ts:1:75 - error TS2305: Module '"vscode"' has no exported member 'CallHierarchyItem'.
  1 import { Disposable, TextDocument, ProviderResult, Position as VPosition, CallHierarchyItem as VCallHierarchyItem [...]

node_modules/vscode-languageclient/lib/common/callHierarchy.d.ts:1:116 - error TS2305: Module '"vscode"' has no exported member 'CallHierarchyIncomingCall'.
  1 import { Disposable, TextDocument, ProviderResult, Position as VPosition, CallHierarchyItem as VCallHierarchyItem, CallHierarchyIncomingCall as VCallHierarchyIncomingCall [...]

I am sure that I an missing something important here, but I have no idea what. Btw, the behavior is the same on linux and windows. Maybe somebody had a similar issue or knows what I am doing wrong. Thanks in advance!

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

As usual, after asking the question I figured it out almost right away.

I did not delete the package-lock.json file. This was the reason for the ton of error messages. It lead to some kind of version mismatch / inconsistency in the code base. So deleting it before executing npm install fixed this issue.

Then, however, the src/extension.ts file with the async function activate() inside showed some errors. The solution here - besides minor follow-ups - is to change

import { LanguageClient, LanguageClientOptions, ...} from 'vscode-languageclient';

to

import { LanguageClient, LanguageClientOptions, ...} from 'vscode-languageclient/node';
over 4 years ago · Santiago Trujillo Relatório

0

Just a follow up answer as this problem seemingly occurs very often: as of version 7.0.0 of the vscode-languageclient package, the codebase was split into "common", "node" and "browser".

split code into common, node and browser to allow using the LSP client and server npm modules in a Web browser via webpack. This is a breaking change and might lead to compile / runtime errors if not adopted. Every module has now three different exports which represent the split into common, node and browser. Lets look at vscode-jsonrpc for an example: (a) the import vscode-jsonrpc will only import the common code, (b) the import vscode-jsonrpc\node will import the common and the node code and (c) the import vscode-jsonrpc\browser will import the common and browser code.

Source: https://github.com/microsoft/vscode-languageserver-node#3160-protocol-600-json-rpc-700-client-and-700-server

Outdated docs are still floating around and it might not be obvious that "npm install vscode-languageclient" will get you the latest version that does not match the old documentation.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda