Giter Club home page Giter Club logo

Comments (7)

rchl avatar rchl commented on July 22, 2024 2

I'll move this to LSP repo to handle this case better. It happened with eslint and other servers before.

from lsp.

rchl avatar rchl commented on July 22, 2024

We should handle that better on the LSP side by not just silently closing the server but this happens because we've received an unexpected payload from Volar's stdout. In this case it's

"Error: Cannot find module '@volar-plugins/prettyhtml'

Require stack:
- /Users/rafal/Downloads/volar-starter-with-nodemodules/volar.config.js
- /usr/local/workspace/github/volarjs/vue/node_modules/.pnpm/@[email protected]/node_modules/@volar/language-server/out/common/utils/serverConfig.js
- /usr/local/workspace/github/volarjs/vue/node_modules/.pnpm/@[email protected]/node_modules/@volar/language-server/out/common/server.js
- /usr/local/workspace/github/volarjs/vue/node_modules/.pnpm/@[email protected]/node_modules/@volar/language-server/out/node/index.js
- /usr/local/workspace/github/volarjs/vue/node_modules/.pnpm/@[email protected]/node_modules/@volar/language-server/node.js
- /usr/local/workspace/github/volarjs/vue/packages/vue-language-server/out/nodeServer.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:963:15)
    at Module._load (node:internal/modules/cjs/loader:811:27)
    at f._load (node:electron/js2c/asar_bundle:2:13330)
    at Module.require (node:internal/modules/cjs/loader:1035:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/rafal/Downloads/volar-starter-with-nodemodules/volar.config.js:3:9)
    at Module._compile (node:internal/modules/cjs/loader:1141:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1196:10)
    at Module.load (node:internal/modules/cjs/loader:1011:32)
    at Module._load (node:internal/modules/cjs/loader:846:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/rafal/Downloads/volar-starter-with-nodemodules/volar.config.js',
    '/usr/local/workspace/github/volarjs/vue/node_modules/.pnpm/@[email protected]/node_modules/@volar/language-server/out/common/utils/serverConfig.js',
    '/usr/local/workspace/github/volarjs/vue/node_modules/.pnpm/@[email protected]/node_modules/@volar/language-server/out/common/server.js',
    '/usr/local/workspace/github/volarjs/vue/node_modules/.pnpm/@[email protected]/node_modules/@volar/language-server/out/node/index.js',
    '/usr/local/workspace/github/volarjs/vue/node_modules/.pnpm/@[email protected]/node_modules/@volar/language-server/node.js',
    '/usr/local/workspace/github/volarjs/vue/packages/vue-language-server/out/nodeServer.js'
  ]
}
Content-Length: 1906

"

I suppose that VSCode is either more permissive in handling stdio or it uses nodeipc instead (we can't switch to it yet due to reliance on Python 3.3).

I will still try to make some fix in LSP to surface those issues to the user.

from lsp.

rchl avatar rchl commented on July 22, 2024

And of course Volar should also post such errors to stderr and not stdout and either close itself or respond with error to initialize.

from lsp.

rchl avatar rchl commented on July 22, 2024

I see that you are actually using Node IPC for communicating with Volar in VSCode. Such issues don't affect IPC communication.

from lsp.

johnsoncodehk avatar johnsoncodehk commented on July 22, 2024

This is the problem line: https://github.com/volarjs/volar.js/blob/master/packages/language-server/src/common/utils/serverConfig.ts#L17

I guess I should try to use connection.logger instead of console?

from lsp.

rchl avatar rchl commented on July 22, 2024

Yes. Or console.error but I suppose console.error would not be surfaced anywhere when using IPC so connection.logger seems more appropriate.

from lsp.

johnsoncodehk avatar johnsoncodehk commented on July 22, 2024

Thanks for confirming, I'll track it upstream.

from lsp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.