PowerShell `vp` wrapper hides failures: `$?` is `True` and `&&` keeps going after `vp` fails
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- powershell, rust, typescript
- 领域
- cli
调研方向
首先阅读 env.ps1 中的 vp 函数,并将它在 PowerShell 中的状态行为与直接运行 vp.exe 进行比较。使用会导致 vp pack 失败的命令重现故障,然后检查 $LASTEXITCODE、$? 和 && 链。完成标准是 wrapper 通过 $? 报告失败,并阻止链继续执行。
由索引模型根据 Issue 内容生成。
描述
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
- Read the Contributing Guidelines.
- Check that there isn't already an issue for the same bug.
- Confirm this is a Vite+ issue and not an upstream issue (Vite, Vitest, tsdown, Rolldown, or Oxc).
- The provided reproduction is a minimal reproducible example.
- 主要语言
- Rust
- 星标
- 6k
- 派生
- 274
- 平均合并
- 1 天 11 小时
- 30 天内合并 PR
- 196
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
voidzero-dev/vite-plus 的其他 Issue
-
`npx --package=vite-plus vp create` fails with exit 127 when npm is the chosen package manager可能已有人在做 @Crimson341 于 1 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 70/100
voidzero-dev/vite-plus#2970 ·
维护者通常 1 天内回复
-
pending triage
难度 2/5 1-3 小时 新手友好度 72/100
voidzero-dev/vite-plus#2882 · 2 条评论 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 62/100
voidzero-dev/vite-plus#2097 · 10 条评论 · 2 个 reaction ·
维护者通常 1 天内回复
-
vp treats a nested project as part of the parent's pnpm workspace, ignoring its own packageManager and lockfile可能已有人在做 @liangmiQwQ 今天认领。 未关闭bug enhancement
voidzero-dev/vite-plus#3013 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Windows: PowerShell installer (1.1.0) does not add vite-plus\bin to user PATH — 'vp' not recognized可能已有人在做 @fengmk2 今天认领。 未关闭
难度 4/5 3-5 天 新手友好度 30/100
voidzero-dev/vite-plus#2984 · 1 条评论 ·
维护者通常 1 天内回复
查看 voidzero-dev/vite-plus 的全部 Issue
相似的 Issue
-
Add Mimir未关闭
难度 1/5 1 小时以内 新手友好度 78/100
slavakurilyak/awesome-ai-agents#759 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 62/100
compiler-explorer/compiler-explorer#9272 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 63/100
pop-os/cosmic-files#2117 ·
维护者通常 2 天内回复
-
L: java:gradle L: java:maven L: ruby:bundler T: bug 🐞
难度 2/5 1-3 小时 新手友好度 76/100
dependabot/dependabot-core#16547 ·
维护者通常 1 天内回复
-
bug status:ready-for-test
难度 2/5 1-3 小时 新手友好度 78/100
UniClipboard/UniClipboard#1985 · 1 条评论 ·
维护者通常 1 天内回复