Pin vue-language-server to v3.2.1 to avoid upstream crash#107
Conversation
|
We require contributors to sign our Contributor License Agreement, and we don't have @raajpatkar on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
|
@cla-bot check |
|
We require contributors to sign our Contributor License Agreement, and we don't have @raajpatkar on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
@cla-bot check |
|
We require contributors to sign our Contributor License Agreement, and we don't have @raajpatkar on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
|
The cla-bot has been summoned, and re-checked this pull request! |
There was a problem hiding this comment.
Pull request overview
Pins the Vue language server dependency to a known-good version to prevent an upstream crash that breaks completions and can cascade into other LSP failures in Zed.
Changes:
- Introduce a
PINNED_SERVER_VERSIONconstant (3.2.1) with rationale and upstream issue link. - Replace dynamic “latest version” resolution with the pinned version when installing
@vue/language-server.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| let version = PINNED_SERVER_VERSION.to_string(); | ||
|
|
||
| if !server_exists | ||
| || zed::npm_package_installed_version(PACKAGE_NAME)?.as_ref() != Some(&version) |
There was a problem hiding this comment.
In server_script_path, the main execution path (the one that runs on the first call, including when the server is already installed) installs TypeScript but never calls install_ts_plugin_if_needed(). Since the only call to install_ts_plugin_if_needed() is in the did_find_server && server_exists early-return branch, the Vue TS plugin may never be installed/updated during a session if this method is only invoked once. Consider calling install_ts_plugin_if_needed() on the main path as well (e.g., next to the TypeScript install) to ensure the TS language servers can load the Vue plugin reliably.
| zed::set_language_server_installation_status( | ||
| language_server_id, | ||
| &zed::LanguageServerInstallationStatus::CheckingForUpdate, | ||
| ); |
There was a problem hiding this comment.
Now that the Vue language server version is pinned, setting the installation status to CheckingForUpdate may be misleading (there’s no upstream update check anymore). Consider using a status that reflects the actual work (e.g., checking installed version / ensuring installed) or only setting CheckingForUpdate when querying npm_package_latest_version.
|
@cla-bot check my username is @theiter8r |
|
We require contributors to sign our Contributor License Agreement, and we don't have @raajpatkar on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
|
The cla-bot has been summoned, and re-checked this pull request! |
Pin the Vue language server to version 3.2.1 to work around a crash in @vue/language-service where `meta?.props.map(...)` throws a TypeError when `meta.props` is undefined. This bug was introduced upstream in vuejs/language-tools#5888 and affects @vue/language-server versions 3.2.2+. Upstream issue: vuejs/language-tools#5956 Fixes: zed-extensions#92
df61204 to
c78b0ca
Compare
MrSubidubi
left a comment
There was a problem hiding this comment.
Thanks! And congrats on your first contribution! 🎉
|
@theiter8r @MrSubidubi Thanks for pinning version it will work as an escape hatch but it seems like upstream won't fix it so we should investigate it further |
Problem
The Vue language server crashes silently in Zed when providing attribute completions. The crash originates in
@vue/language-serviceatvue-template.js:604, where the code uses:This throws a
TypeError: Cannot read properties of undefined (reading 'map')whenmetaexists butmeta.propsisundefined. The safe form would bemeta?.props?.map(...).This bug was introduced upstream in vuejs/language-tools#5888 and affects
@vue/language-serverversions 3.2.2+.Upstream issue: vuejs/language-tools#5956
Solution
Pin
@vue/language-serverto version 3.2.1 (the last known working version before the buggy change) instead of dynamically fetching the latest version vianpm_package_latest_version.This is a temporary workaround. Once the upstream package publishes a fix, the pin should be removed so users can receive future updates.
Changes
PINNED_SERVER_VERSIONconstant set to"3.2.1"with a comment explaining the reason and linking to the upstream issue.zed::npm_package_latest_version(PACKAGE_NAME)?withPINNED_SERVER_VERSION.to_string()inserver_script_path.TODOcomment to remove the pin once upstream is fixed.Fixes #92