Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module 'vscode-languageserver-protocol/lib/protocol.sematicTokens.proposed' #247

Closed
raxod502 opened this issue Dec 18, 2020 · 10 comments
Labels

Comments

@raxod502
Copy link

raxod502 commented Dec 18, 2020

The server fails to start after being installed.

% npm i dockerfile-language-server-nodejs

added 10 packages, and audited 10 packages in 672ms

found 0 vulnerabilities
% npx docker-langserver
node:internal/modules/cjs/loader:928
  throw err;
  ^

Error: Cannot find module 'vscode-languageserver-protocol/lib/protocol.sematicTokens.proposed'
Require stack:
- /tmp/jpojoijiog/node_modules/dockerfile-language-service/lib/dockerSemanticTokens.js
- /tmp/jpojoijiog/node_modules/dockerfile-language-service/lib/languageService.js
- /tmp/jpojoijiog/node_modules/dockerfile-language-service/lib/main.js
- /tmp/jpojoijiog/node_modules/dockerfile-language-server-nodejs/lib/server.js
- /tmp/jpojoijiog/node_modules/dockerfile-language-server-nodejs/bin/docker-langserver
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Module.require (node:internal/modules/cjs/loader:997:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at /tmp/jpojoijiog/node_modules/dockerfile-language-service/lib/dockerSemanticTokens.js:16:45
    at /tmp/jpojoijiog/node_modules/dockerfile-language-service/lib/dockerSemanticTokens.js:3:17
    at Object.<anonymous> (/tmp/jpojoijiog/node_modules/dockerfile-language-service/lib/dockerSemanticTokens.js:9:3)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:973:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/tmp/jpojoijiog/node_modules/dockerfile-language-service/lib/dockerSemanticTokens.js',
    '/tmp/jpojoijiog/node_modules/dockerfile-language-service/lib/languageService.js',
    '/tmp/jpojoijiog/node_modules/dockerfile-language-service/lib/main.js',
    '/tmp/jpojoijiog/node_modules/dockerfile-language-server-nodejs/lib/server.js',
    '/tmp/jpojoijiog/node_modules/dockerfile-language-server-nodejs/bin/docker-langserver'
  ]
}
npm ERR! code 1
npm ERR! path /tmp/jpojoijiog
npm ERR! command failed
npm ERR! command sh -c docker-langserver

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/raxod502/.npm/_logs/2020-12-18T02_06_38_786Z-debug.log

This appears to be with version 0.1.1 of the package, according to the generated package.json. Ubuntu 20.04.

@rcjsuen
Copy link
Owner

rcjsuen commented Dec 18, 2020

@raxod502 Thank you for your bug report. I can reproduce the issue.

@raxod502
Copy link
Author

Nice! You have my utmost sympathy, by the way, for having to debug things related to vscode-languageserver-protocol. I've used that package before, and it was most assuredly not fun 😢

@GopherJ
Copy link

GopherJ commented Dec 24, 2020

any news about this?

@rcjsuen
Copy link
Owner

rcjsuen commented Dec 24, 2020

@GopherJ Sorry, I'm busy with my day job but hope to have some time over the holidays. Which editor is this affecting?

@christianbundy
Copy link

I'm building a small editor that only speaks LSP and it's affecting me, since I can't start the language server.

@rcjsuen rcjsuen added the bug label Dec 24, 2020
@GopherJ
Copy link

GopherJ commented Dec 25, 2020

@rcjsuen hi, I'd really want to test coc-docker and imporve it, it uses this project internally, could you guide us on how to fix it so that we can maybe help. I see your change on docker-language-service but maybe it's not released and used here?

Merry Christmas BTW! Be safe guys!

@rcjsuen
Copy link
Owner

rcjsuen commented Dec 25, 2020

could you guide us on how to fix it so that we can maybe help.

@GopherJ I have a hunch about what the issue is and am actively looking at it.

I see your change on docker-language-service but maybe it's not released and used here?

The language server is powered by three libraries and the language service is one of them. I'm cutting releases for the other dependent libraries as we speak so that I can merge them into the next release of the language server.

Merry Christmas BTW! Be safe guys!

Thank you and I hope everyone is able to take some time off over the holidays.

@rcjsuen
Copy link
Owner

rcjsuen commented Dec 25, 2020

@raxod502 Thanks again for bringing this issue to my attention. From what I can find, it seems this was due to my use of proposed LSP 3.16 APIs without specifying hard version requirements in my package.json file. This led to issues when they were replaced by the official API on December 14th. This explains why this was not reported earlier given that 0.1.1 has been out in the wild for about half a year.

The new 0.2.0 release that has just been published to npm should be fixed. If everyone on this ticket could take a look see and confirm that, you have my thanks!

Lastly, I want to thank everyone again for your patience. :)

@raxod502
Copy link
Author

Wonderful, thank you so much! I can confirm the updated version of the language server is working.

@christianbundy
Copy link

Thank you! I can confirm that textDocumentsemanticTokens/full` works beautifully. ✨

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants