-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
tsserver throws when creating new .vue files as typescript.tsserver.experimental.useVsCodeWatcher defaults to true #214226
Comments
Thanks for your investigation! @sheetalkamat I found that this change caused the TS plugin to never receive |
Closing as caused by extension/plugin. Please file an issue against them |
@mjbvz I don't think this is caused by the Vue extension, it seems more like an issue with communication between tsserver and typescript-language-features, or an internal state issue with tsserver when I think VSCode needs to wait for tsserver to support the use case of using |
Out of the box we won't watch Also |
Sorry if we didn't make it clear. The Vue extension does not watch Vue files by default, but enables tsserver to recognize Vue files through the Vue TS plugin, and tsserver will watch Vue files on its own. When
What I mean is that if tsserver does not support |
Yes and the problem is that the Vue extension needs to support the new file watching logic. They can follow up with TypeScript if they think there's some larger issues but the issue should start on the Vue side |
I just want to reiterate that this issue is not specific to the Vue extension, as far as I know it also breaks the MDX extension, and will break the Glint extension in the next version (it will move to the TS plugin). If you mean this issue should be reported to TypeScript by the Vue team, we can do that. However, the fix may not be released until 5.6, and before the tsdk built into VSCode is upgraded to that fixed version, |
yes please do and provide them a detailed explanation of the issue The new file watching has been enabled since the May VS Code release and was enabled for VS Code insiders as a test experiment before that. This should have been caught much earlier on the Vue side and reported to TS back when there was still time to get a quick fix in or hold off on enabling the feature by default. We're past that point now but could possibly get a fix into a TS 5.5.x release if the fix is relatively simple |
This is impacting Glint's TS Plugin as well.
I don't think there's a strong argument against restoring the value of an experimental flag back to false until all known bugs impacting large communities like Vue are resolved. |
Has anyone actually opened an issue against TS yet? You can downvote me all you want and think I'm being very unreasonable but I've told you what will move the issue forward. Please do it. It's really not difficult
The file watching switch was made because file watching issues were impacting our users. We feel it is the best change for all of our js/ts users, which is a much, much larger set of folks than those using these various plugins |
You can say whatever you want, but
isn't particularly great comment to make about community-run OSSs. Also, as someone who haven't used Vue for ages, I think it's VSCode team's responsibility to test new versions against various popular plugins, especially something like Vue. |
The issue at hand
Implications of whether to rollback the defaultTo me there two possible ways to handle this issue:
Isn't the ability to do (2) precisely the purpose of "experimental" features?
Are you saying the VSCode team doesn't think it's their responsibility to ensure compatibility with tsserver, but rather it's the extension authors' responsibility to do so?
As already mentioned by @johnsoncodehk:
On the other hand - is it really that difficult to temporarily rollback the default value of a feature until it is actually stable? |
Repeating myself once again: open an issue against TypeScript that clearly explains that issue so this can be investigated and addressed. Ideally help them out too with a PR that fixes this I even offered to try getting any TS side fix prioritized for a TS 5.5.x recovery release. That would be picked up by the next stable VS Code release, which is also when your proposed VS Code file watcher setting change would go in |
|
as a workaround, could the Vue extension toggle the flag for the user? I know that's pretty bad in general but this case is special. |
This is so d**m "experimental" 😧 |
I opened microsoft/TypeScript#59349 to track this. Initial investigation suggests the Vue plugin is using TS server apis in an unexpected way, although it's not yet clear if a fix is needed on the Vue or TS sides Until there's a proper fix, here are a few possible workarounds to investigate:
I am now locking this issue as further discussion should happen on the issue TypeScript or in the Vue extension repos. Thank you to the folks helping more this forward, specifically to @johnsoncodehk plus @sheetalkamat and the TS team At this point, I think it's worth recapping what happened so we can learn from it: TypeScript server plugins like Vue are some of the most complicated and fragile parts of the VS Code ecosystem. The way they work is closer to patching our source code compared to our normal APIs. Given this, TS server plugin maintainers need to be extra diligent about testing on the latest VS Code releases and providing feedback to us early VS Code shipped our file watching changes in early May with VS Code 1.89 (early April for VS Code insiders users). We documented these changes in our release notes and also rolled them out incrementally. If we had gotten a detailed issue report early in the rollout process, we could have prioritized a fix or potentially even delayed the rollout An issue related to the new watcher was actually reported to Vue at the end of May (vuejs/language-tools#4424) It does not seem like this issue was investigated in depth on the Vue side at that time This current issue was then reported to VS Code in early June. As the majority of extension specific issues are caused by extensions themselves, I delegated the issue back to Vue. After extension maintainers do a deeper investigation, if a bug is truly caused by VS Code, the maintainers can give us more detailed technical info and we can work together on a fix. Again though, the root cause is typically the extension code itself I don't know why this issue blew up in the past few days. Even though I wish the issue has been investigated sooner, I also get it. Sometimes issues get lost or there's simply no time. When this happens, of course we still want to work towards finding a solution. But by mid July it was too late to revert the rollout of the new watcher. Not only would this regress the experience for non Vue users, rolling back to old code has its own risks I am disappointed by how the issue has been handled since then. When issues like this happen, it is not ok to try shifting all of the blame to us or to come in and demand that we make changes without showing that you are willing to do the serious work to understand or address the root of the problem. This really should have been as simple as: "Here's the issue where we're tracking the bug on our side, it should be fixed in our next release. We considered all other approaches but think a workaround is needed on the VS Code side too, so until our fix goes out here's a PR that works around this for just the Vue users." I tried to help in this issue by repeatedly giving specific instructions on how to get this issue moving forward. In response I was ignored and disrespected. This behavior has gone completely against good open source etiquette and it contributed nothing to getting the issue fixed At the end of the day I know we are all trying to build the best tools for our users. It's good to be passionate but that passion needs to be channeled in a productive and professional way As I said, it looks like we've got good momentum getting this addressed now. Hopefully this whole experience can also be a good learning moment so we can all do better going forward |
Type: Bug
The new default == true of typescript.tsserver.experimental.useVsCodeWatcher (introduced in 1.89) https://code.visualstudio.com/updates/v1_89#_file-watching-handled-by-vs-code-core breaks the Volar extension.
volar
extensionpnpm create vite@latest
pnpm install
VS Code version: Code 1.89.1 (Universal) (dc96b83, 2024-05-07T05:14:24.611Z)
OS version: Darwin arm64 23.3.0
Modes:
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
Extensions (13)
(3 theme extensions excluded)
A/B Experiments
The text was updated successfully, but these errors were encountered: