vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.79k stars 390 forks source link

Visual Studio Code - vue.volar extension - JS/TS language service cannot be started successfully #4285

Closed nico-sth closed 1 month ago

nico-sth commented 5 months ago

When loading/opening a non-Vue project (e.g. NextJS [React]) with the Visual Studio Code vue.volar extension installed (v2.0.10+) I get the following error message:

Screenshot 2024-04-22 at 10 09 05

Downgrading vue.volar to v2.0.6 or disabling the extension altogether fixes this issue. Loading a Vue project (e.g. Nuxt) does not experience this issue.

abarke commented 5 months ago

Same here suing Vue - Official v2.0.10:

image

abarke commented 5 months ago

Still an issue in v2.0.14

This problem is really effecting DX... no type completion and refactoring of types is really bad. Productivity down 80%.

- Operating System: Windows_NT
- Node Version:     v18.15.0
- Nuxt Version:     3.7.1
- CLI Version:      3.9.1
- Nitro Version:    2.7.0
- Package Manager:  pnpm@8.15.5
- Builder:          -
- User Config:      ssr, css, modules, ionic, vite, nitro
- Runtime Modules:  @nuxtjs/ionic@0.12.1, nuxt-electron@0.6.0
- Build Modules:    -
johnsoncodehk commented 5 months ago

Could you share the tsserver log?

Refs: https://github.com/microsoft/TypeScript/wiki/Getting-logs-from-TS-Server-in-VS-Code

abarke commented 5 months ago

OK I think I fixed it for now... though I do not know the reason.

I tried older versions of volar e.g. v2.0.6, but the problem still persisted.

Using now vue.volar@2.0.14, I cloned my project into another folder and started fresh. Now everything is working as expected. Type completion and refactoring now work fine.

I manged to pull a few entries out of the logs as requested.. not sure that helps, but does look fishy somehow:

Info 480  [11:41:25.224] DirectoryWatcher:: Added:: WatchInfo: c:/Users/SuperUser/Code/fab-app/package.json 1 undefined Project: c:/Users/SuperUser/Code/fab-app/tsconfig.json WatchType: Failed Lookup Locations
Info 481  [11:41:25.224] watchDirectory for c:/Users/SuperUser/Code/fab-app/package.json uses cached drive information.
Info 482  [11:41:25.224] Elapsed:: 0.14120000042021275ms DirectoryWatcher:: Added:: WatchInfo: c:/Users/SuperUser/Code/fab-app/package.json 1 undefined Project: c:/Users/SuperUser/Code/fab-app/tsconfig.json WatchType: Failed Lookup Locations
Info 483  [11:41:25.225] FileWatcher:: Added:: WatchInfo: c:/Users/SuperUser/Code/fab-app/package.json 500 undefined WatchType: Closed Script info
Info 484  [11:41:25.247] FileWatcher:: Added:: WatchInfo: C:\Users\SuperUser\Code\fab-app\node_modules\.pnpm\aws-iot-device-sdk-v2@1.19.5\node_modules\aws-iot-device-sdk-v2\package.json 2000 undefined Project: c:/Users/SuperUser/Code/fab-app/tsconfig.json WatchType: File location affecting resolution
davidmatter commented 1 month ago

Closing this one as many things have changed in the latest 2.x versions. Feel free to create a new issue with a minimal reproduction if you're still having issues, thanks!