vuejs / language-tools

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

Vue server crashed after upgrading to v2.0.21 in VSCode + Nuxt 3 #4460

Open haoliangwu opened 2 weeks ago

haoliangwu commented 2 weeks ago

Vue - Official extension or vue-tsc version

2.0.21

VSCode version

1.90.0

Vue version

3.4.27

TypeScript version

5.4.5

System Info

System:
    OS: macOS 14.5
    CPU: (8) arm64 Apple M3
    Memory: 112.33 MB / 24.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm
    pnpm: 9.1.4 - ~/.nvm/versions/node/v20.12.2/bin/pnpm
  Browsers:
    Chrome: 125.0.6422.142
    Safari: 17.5

Steps to reproduce

just install the plugin and open a file with .vue extension.

Link to minimal reproduction

No response

Any additional comments?

haoliangwu commented 2 weeks ago

the screenshot of crashing:

image
davidmatter commented 2 weeks ago

Please provide a more complete reproduction than just install the plugin and open a file with .vue extension. You can find a good example here https://github.com/vuejs/language-tools/issues/4457

so1ve commented 2 weeks ago

Agreed. And the screenshot doesn't provide any useful information since the code is optimized, you'd better copy the whole error log then upload as a file.

honking commented 2 weeks ago

I have the same problem, here is the log from output

Error: [UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character at p (/root/.vscode-server/extensions/vue.volar-2.0.21/dist/server.js:3:22193) at new f (/root/.vscode-server/extensions/vue.volar-2.0.21/dist/server.js:3:23300) at new k (/root/.vscode-server/extensions/vue.volar-2.0.21/dist/server.js:3:24396) at f.from (/root/.vscode-server/extensions/vue.volar-2.0.21/dist/server.js:3:24092) at Object.n [as asUri] (/root/.vscode-server/extensions/vue.volar-2.0.21/dist/server.js:76:10682) at f (/root/.vscode-server/extensions/vue.volar-2.0.21/dist/server.js:76:1286) at Object.d [as getModifiedTime] (/root/.vscode-server/extensions/vue.volar-2.0.21/dist/server.js:76:1064) at /root/.vscode-server/extensions/vue.volar-2.0.21/dist/server.js:76:5648 at Object.get (/root/.vscode-server/extensions/vue.volar-2.0.21/dist/server.js:3:10434) at x (/root/.vscode-server/extensions/vue.volar-2.0.21/dist/server.js:355:16489)

Node.js v18.18.2 [Error - 16:43:37] Server process exited with code 1. [Error - 16:43:37] The Vue server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

davidmatter commented 2 weeks ago

Which vscode version are you on? Node v18.18 doesn't sound right. Also, please write how to reproduce this, add your extension list, the platform, vscode version etc.

sdr0x07b6 commented 1 week ago

I'm having trouble with the same crash. CleanShot 2024-06-13 at 18 20 12

I don't know how to reproduce it. I mostly work with Nuxt3 projects, and when I open some of my projects, some reproduce and some don't. Just opening them reproduces the problem. There are no specific steps to reproduce it.

All the projects that I can notice that reproduce the problem are work products, so I can't share them.

I just tried creating a new project using Nuxt latest, but that didn't reproduce it.

davidmatter commented 1 week ago

Thanks for the detailed information. Please try to create a new (empty) profile in vscode and activate only the volar extension to see if the problem persists without all those other extensions.

sdr0x07b6 commented 1 week ago

@davidmatter

activate only the volar extension

Didn't reproduce.

I enabled and disabled each of the many extensions I had installed, while repeatedly restarting the extension host. In the end, I found that disabling just this one while still enabling all of the extensions made the issue disappear...!

vscode-styled-components https://marketplace.visualstudio.com/items?itemName=styled-components.vscode-styled-components

% code --list-extensions --show-versions | grep styled
styled-components.vscode-styled-components@1.7.8

As I mentioned, there are no specific steps to reproduce the issue, and in my environment, whenever I open a project or restart the extension host, it crashes after 11 seconds. This was resolved by disabling vscode-styled-components.

However, this should not be taken as a solution to the problem, but rather the conflict should be improved. The most recent update for Vue - Official was 2024-06-08, 23:50:09. Now that you mention it, the problem has been occurring for a few days, so it seems likely that the difference included in this update is the cause.

so1ve commented 1 week ago

Could you please show this tab:

image

You'd better set hybridMode to auto to avoid compatibility issues.

sdr0x07b6 commented 1 week ago

@so1ve Thanks for the message.

First, here is the message you see when vscode-styled-components is enabled. vscode-styled-components

書式設定拡張機能 'Vue - Official' はフォーマッタとして構成されていますが、'vue'-ファイルをフォーマットできません

This is what the Japanese message means.

The formatting extension 'Vue - Official' is configured as the formatter but is unable to format 'vue'-files

When I opened the configuration link “構成...”, a list with only one option, "Prettier", appeared, and I had no choice but to choose it, so I chose it without really understanding what to do. Then the above Japanese message disappeared. However, the problem did not improve. vscode-styled-components_2

Next, here is the message when vscode-styled-components is disabled. without_vscode-styled-components

In Hybrid Mode, it's always Auto from the start, whether there's a problem or not.

Both are set to Auto, but I found that they are only disabled when there is a problem, so I tried forcing them to true in the settings. Then the problem did not occur again!

However, I don't understand what this means. Also, are there any disadvantages to forcing Hybrid Mode to always be set to true?

To begin with, there were no problems until the other day, but this issue occurred around the same time as the Vue - Official update. Is it the right solution to always keep it set to true?

sdr0x07b6 commented 1 week ago

Also, there was an update to VSCode v1.90.1 today, but updating it did not change the situation.

so1ve commented 1 week ago

Forcing Hybrid Mode to always be set to true will make language tools crash when there is other extensions that uses a ts plugin enabled, so we'd better left it to auto to keep best compatibility. But sry I have no idea about the crash :(

jagoncalves14 commented 7 hours ago

@haoliangwu, I was having the same problem as you.

However, the most recent update of Vue - Official (v2.0.22) seems to have solved the issue.

sdr0x07b6 commented 7 hours ago

@jagoncalves14 Thanks for letting everyone know!

The issue no longer occurs even when vscode-styled-components is enabled.