Skip to content

Pin vue-language-server to v3.2.1 to avoid upstream crash#107

Merged
MrSubidubi merged 2 commits intozed-extensions:mainfrom
theiter8r:fix/pin-vue-language-server-version
Mar 18, 2026
Merged

Pin vue-language-server to v3.2.1 to avoid upstream crash#107
MrSubidubi merged 2 commits intozed-extensions:mainfrom
theiter8r:fix/pin-vue-language-server-version

Conversation

@theiter8r
Copy link

Problem

The Vue language server crashes silently in Zed when providing attribute completions. The crash originates in @vue/language-service at vue-template.js:604, where the code uses:

meta?.props.map(prop => [prop.name, prop]) ?? []

This throws a TypeError: Cannot read properties of undefined (reading 'map') when meta exists but meta.props is undefined. The safe form would be meta?.props?.map(...).

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

Solution

Pin @vue/language-server to version 3.2.1 (the last known working version before the buggy change) instead of dynamically fetching the latest version via npm_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

  • Added a PINNED_SERVER_VERSION constant set to "3.2.1" with a comment explaining the reason and linking to the upstream issue.
  • Replaced zed::npm_package_latest_version(PACKAGE_NAME)? with PINNED_SERVER_VERSION.to_string() in server_script_path.
  • Added a TODO comment to remove the pin once upstream is fixed.

Fixes #92

Copilot AI review requested due to automatic review settings March 12, 2026 00:27
@cla-bot
Copy link

cla-bot bot commented Mar 12, 2026

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'.

@theiter8r
Copy link
Author

@cla-bot check

@cla-bot
Copy link

cla-bot bot commented Mar 12, 2026

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
Copy link

cla-bot bot commented Mar 12, 2026

The cla-bot has been summoned, and re-checked this pull request!

@theiter8r
Copy link
Author

@cla-bot check

@cla-bot
Copy link

cla-bot bot commented Mar 12, 2026

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
Copy link

cla-bot bot commented Mar 12, 2026

The cla-bot has been summoned, and re-checked this pull request!

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_VERSION constant (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.

Comment on lines +57 to 60
let version = PINNED_SERVER_VERSION.to_string();

if !server_exists
|| zed::npm_package_installed_version(PACKAGE_NAME)?.as_ref() != Some(&version)
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines 53 to 56
zed::set_language_server_installation_status(
language_server_id,
&zed::LanguageServerInstallationStatus::CheckingForUpdate,
);
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@theiter8r
Copy link
Author

@cla-bot check my username is @theiter8r

@cla-bot
Copy link

cla-bot bot commented Mar 12, 2026

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
Copy link

cla-bot bot commented Mar 12, 2026

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
@MrSubidubi MrSubidubi changed the title fix: pin @vue/language-server to 3.2.1 to avoid upstream crash Pin vue-language-server to v3.2.1 to avoid upstream crash Mar 18, 2026
Copy link
Contributor

@MrSubidubi MrSubidubi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! And congrats on your first contribution! 🎉

@MrSubidubi MrSubidubi merged commit 5a1cc60 into zed-extensions:main Mar 18, 2026
5 checks passed
@phsd0
Copy link

phsd0 commented Mar 18, 2026

@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

vuejs/language-tools#5956 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vue LSP throws an error silently after a diagnostic error, then stops working along with other LSP servers active in that file

4 participants