Vetur: Server crash, resolved by upgrading typescript

Created on 9 Jan 2019  路  6Comments  路  Source: vuejs/vetur

  • [x] I have searched through existing issues
  • [x] I have read through docs
  • [x] I have read FAQ

Info

  • Platform: Win 10 x64
  • Vetur version: 0.14.5
  • VS Code version: 1.30.2

Problem

This is sort of a lame issue report, but I was getting a consistent crash ("the vue language server crashed 5 times in the last 3 minutes") in a large project, occurring in the typescript package running within vetur's language server. When I upgraded typescript from 2.8.4 (specified in package.json) to latest (3.2.2), the crash went away. That also seems to have improved performance significantly. You might want to consider officially upgrading that package.

typescript

Most helpful comment

Yeah, Vetur should be able to work with any version of TypeScript. Maybe I should allow another path pointing to a specific ver of TypeScript, like VS Code:

{
   "typescript.tsdk": "/usr/local/lib/node_modules/typescript/lib"
}

And I meant to link to https://github.com/vuejs/vetur/issues/922.

All 6 comments

I just wanted to add on to what @zbjornson said,
I was having this issue too, but found that due to our workflow we had both typescript installed as a package for the project, but also needed typescript installed globally for the IDE, (I forget why, but we do).

But this fact was forgotten for a few days and was scratching my head why I was still getting old issues for typescript being reported.

Now I have global and local versions of typescript installed @ 3.2.2 and everything seems to be fine so far. 馃

Here are some context why it's still in 2.8:

How did you upgrade to 3.2.2? Did you go to ~/.vscode/extensions/octref.vetur.something and installed TypeScript manually under /server?

The new vetur.dev.vlsPath could also help you: https://github.com/vuejs/vetur/blob/master/.github/CONTRIBUTING.md

It's simple as:

  • Clone Vetur
  • Install latest TS under /server
  • Build Vue Language Server (/server)
  • Point your VS Code installation of Vetur to it

@octref thanks for the context. You linked #913 twice btw. That talks about TS 3.0, so perhaps whatever that issue was is resolved now in 3.2. I don't see high CPU usage currently.

Yes on the 2nd part, I ran yarn add typescript@latest inside .vscode/extensions/octref___/server. Thanks for the vlsPath tip! That'll help as I'd like to see what I can do to work on #547 (major issue for our large Vue project).

Yeah, Vetur should be able to work with any version of TypeScript. Maybe I should allow another path pointing to a specific ver of TypeScript, like VS Code:

{
   "typescript.tsdk": "/usr/local/lib/node_modules/typescript/lib"
}

And I meant to link to https://github.com/vuejs/vetur/issues/922.

@zbjornson Oh god, many thanks for the steps provided. I never got TypeScript working since I installed Vetur. Just updated TypeScript of Vetur to 3.4.5 with the steps provided in this ticket and the extension now finally works. 鉂わ笍

BTW now "vetur.useWorkspaceDependencies": true will use node_modules/typescript over bundled TS version (which is 3.3.4000).

Was this page helpful?
0 / 5 - 0 ratings