Skip to content

feat(js-executor): block vp commands when Node.js version is incompatible#1360

Merged
fengmk2 merged 19 commits intovoidzero-dev:mainfrom
liangmiQwQ:fix/block-running-with-unsupported-node
Apr 13, 2026
Merged

feat(js-executor): block vp commands when Node.js version is incompatible#1360
fengmk2 merged 19 commits intovoidzero-dev:mainfrom
liangmiQwQ:fix/block-running-with-unsupported-node

Conversation

@liangmiQwQ
Copy link
Copy Markdown
Contributor

@liangmiQwQ liangmiQwQ commented Apr 11, 2026

Closes #1358

This PR added check logic to block running / downloading node with unsupported node versions.

The check logic is added in ensure_project_runtime fn to make sure all vp commands run locally node be checked, not only for Categories C cmds. While direct node won't be influenced.

Generated with Claude Code

liangmiQwQ and others added 2 commits April 11, 2026 16:54
… vp JS commands

When a user sets an incompatible Node.js version via `vp env use`, all JS-based
vp commands fail with cryptic errors. This adds an explicit check in
`ensure_project_runtime()` that compares the resolved version against vp's own
engine requirements (read from the CLI's package.json). If the version is outside
the required range an `Error::NodeVersionIncompatible` is returned with a clear
message and a hint to run `vp env use 22`.

System runtimes (version = "system") and unparseable versions are skipped silently
so `vp env off` users are not affected.

Fixes voidzero-dev#1358

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…heck

Cover check_runtime_compatibility (compatible, v-prefixed, incompatible, system,
unparseable version, invalid requirement range) and get_cli_engines_requirement
(reads engines.node from package.json, returns None when package.json is missing).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 11, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 08eff05
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69dc48572c88d10008f99c19

@liangmiQwQ liangmiQwQ changed the title feat(js-executor): block vp commands when Node.js version is incompatible fix(js-executor): block vp commands when Node.js version is incompatible Apr 11, 2026
@liangmiQwQ liangmiQwQ changed the title fix(js-executor): block vp commands when Node.js version is incompatible feat(js-executor): block vp commands when Node.js version is incompatible Apr 11, 2026
@liangmiQwQ liangmiQwQ force-pushed the fix/block-running-with-unsupported-node branch from 21ab3bf to e2a1a36 Compare April 11, 2026 10:35
@liangmiQwQ
Copy link
Copy Markdown
Contributor Author

liangmiQwQ commented Apr 11, 2026

Done! There are a few test snapshots got updated as they are using node version out of vp's engines scope defined in package.json

@liangmiQwQ liangmiQwQ marked this pull request as ready for review April 11, 2026 11:06
@fengmk2
Copy link
Copy Markdown
Member

fengmk2 commented Apr 12, 2026

@codex review

@fengmk2 fengmk2 added the test: e2e Auto run e2e tests label Apr 12, 2026
@fengmk2 fengmk2 self-assigned this Apr 12, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e3f3b046ba

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/vite_global_cli/src/js_executor.rs Outdated
Comment thread crates/vite_global_cli/src/error.rs Outdated
@fengmk2
Copy link
Copy Markdown
Member

fengmk2 commented Apr 12, 2026

@liangmiQwQ Can we add a snap test for block error reporting? To ensure this functionality remains effective in future changes.

Others LGTM ❤️

@liangmiQwQ
Copy link
Copy Markdown
Contributor Author

Got it, I would add it soon

@liangmiQwQ liangmiQwQ marked this pull request as draft April 12, 2026 09:11
@liangmiQwQ liangmiQwQ marked this pull request as ready for review April 12, 2026 09:36
@liangmiQwQ liangmiQwQ requested a review from fengmk2 April 12, 2026 09:46
@liangmiQwQ liangmiQwQ marked this pull request as draft April 12, 2026 14:31
@liangmiQwQ liangmiQwQ marked this pull request as ready for review April 12, 2026 21:49
Copy link
Copy Markdown
Member

@fengmk2 fengmk2 left a comment

Choose a reason for hiding this comment

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

@liangmiQwQ Thanks again!

@fengmk2 fengmk2 merged commit 4d9bc46 into voidzero-dev:main Apr 13, 2026
70 checks passed
@liangmiQwQ liangmiQwQ deleted the fix/block-running-with-unsupported-node branch April 13, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test: e2e Auto run e2e tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JS based tools in vp stop working after setting an incompatible node version with vp env

2 participants