Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

PowerShell `vp` wrapper hides failures: `$?` is `True` and `&&` keeps going after `vp` fails

已关闭 适合新手
#2,934 2 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@fengmk2 已经在做这个了。

开始于 2026年10月8日。

  • #2947 来自 @fengmk2 —— 已合并

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
powershell, rust, typescript
领域
cli

调研方向

首先阅读 env.ps1 中的 vp 函数,并将它在 PowerShell 中的状态行为与直接运行 vp.exe 进行比较。使用会导致 vp pack 失败的命令重现故障,然后检查 $LASTEXITCODE、$? 和 && 链。完成标准是 wrapper 通过 $? 报告失败,并阻止链继续执行。

由索引模型根据 Issue 内容生成。

描述

bug pending triage
Describe the bug

In PowerShell, the vp function defined in env.ps1 loses the exit status of the vp.exe binary. When a command fails, $LASTEXITCODE is set correctly, but $? is True.

Reproduction

see below

Steps to reproduce

example vite.config.ts:

export default defineConfig({
  pack: {
    entry: 'src/does-not-exist.js'
  },
});

In powershell:

> vp pack
VITE+ - The Unified Toolchain for the Web

ℹ entry: src/does-not-exist.js
...
error: Build failed with 1 error:

[UNRESOLVED_ENTRY] Cannot resolve entry module src/fail.js.

    at ...

> "$LastExitCode $?"
1 True

vp pack returns with exit code 1 (good), and with status True (bad).

running vp.exe directly does not have this issue:

> vp.exe pack           
VITE+ - The Unified Toolchain for the Web

ℹ entry: src/does-not-exist.js
...
error: Build failed with 1 error:

[UNRESOLVED_ENTRY] Cannot resolve entry module src/fail.js.

    at ...

> "$LastExitCode $?"    
1 False

with vp.exe, $? correctly outputs False, which correctly breaks && chains for example

System Info
> vp env current
VITE+ - The Unified Toolchain for the Web

Node.js:
  Version    26.11.0
  Source     devEngines.runtime
  Bin Path   C:\Users\me\AppData\Local\vite-plus\data\js_runtime\node\26.11.0\node.exe
  Installed  true
  Mode       managed

Package Manager:
  Name       npm
  Version    12.2.0
  Source     devEngines.packageManager
  Bin Paths  
    npm      C:\Users\me\AppData\Local\vite-plus\data\package_manager\npm\12.2.0\npm\bin\npm.cmd
    npx      C:\Users\me\AppData\Local\vite-plus\data\package_manager\npm\12.2.0\npm\bin\npx.cmd
  Installed  true
  Mode       managed

> vp --version  
VITE+ - The Unified Toolchain for the Web

vp v1.1.0

Local vite-plus:
  vite-plus  v1.1.0

Tools:
  vite             v8.3.3
  rolldown         v1.2.12
  vitest           v5.0.3
  oxfmt            v0.72.0
  oxlint           v1.87.0
  oxlint-tsgolint  v7.0.2003
  tsdown           v0.23.0

Environment:
  Package manager  npm ^12.2.0
  Node.js          v26.11.0 (devEngines.runtime)
Used Package Manager

npm

Logs

Validations
主要语言
Rust
星标
6k
派生
274
平均合并
1 天 11 小时
30 天内合并 PR
196

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

voidzero-dev/vite-plus 的其他 Issue

查看 voidzero-dev/vite-plus 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。