`vp run`: scripts get a non-blocking stdin (EAGAIN) when `run` tasks in vite.config.ts use constants
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- bun, node.js, rust, typescript
調査の方向性
Start by tracing vp run startup and how it loads vite.config.ts and starts the task process; the report points to ensureBlockingStdio() in dist/bin.js as related context. Reproduce with the supplied project, comparing the constant reference and string literal configurations, then inspect where stdin becomes non-blocking. Done means both configurations keep the probe waiting for input and the interactive update prompt accepts input.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
On macOS, interactive prompts started with vp run exit without waiting for input when a task in the run block of vite.config.ts references a constant.
With Bun as the package manager, vp run up, where up is vp update --interactive --latest, prints the package list and exits with Selected 0 packages to update before any key is pressed. Running vp update --interactive --latest directly, or bun run up, waits for input.
A blocking read of stdin shows the cause: the script started by vp run gets a stdin in non-blocking mode. probe.mjs calls readSync(0), and under vp run that call fails right away with EAGAIN. I have not identified what sets O_NONBLOCK.
Neither vp run probe nor vp run up invokes the hello task defined in the run block. Changing its command from a constant reference to the same string literal changes whether these scripts wait for input:
vite.config.ts |
vp run probe |
|---|---|
no run block |
waits for input, then prints stdin is blocking |
run: { tasks: { hello: { command: 'echo hello' } } } |
waits for input, then prints stdin is blocking |
const command = 'echo hello' and run: { tasks: { hello: { command } } } |
prints stdin is non-blocking: EAGAIN immediately, without waiting for input |
After vp exits, stdin returns to blocking mode.
I found this through vp run deps:update in a project whose run tasks spread shared constants into cache.input. There it happened with vite-plus 1.2.0 and 1.3.0. I tested the reproduction below with 1.3.0.
Possibly related: #2173 added ensureBlockingStdio(), which vite-plus 1.3.0 calls at startup in dist/bin.js. This case still happens on 1.3.0. I have not established whether the two share a cause.
Reproduction
https://github.com/everton-dgn/vp-run-stdin-nonblock
Steps to reproduce
Open a terminal in the reproduction directory. Run the commands below with stdin connected to the terminal, without piping or redirecting input.
bun installvp run probe- Expected: it prints
Waiting for one byte on stdin. Press Enter.and waits. After Enter, it printsstdin is blocking. - Actual: it prints
stdin is non-blocking: EAGAINwithout waiting.
- Expected: it prints
vp run up- Expected: the package selection list waits for input.
- Actual: the list is drawn and then replaced right away by
Selected 0 packages to updateandNo packages selected for update.
- Controls. Run
node probe.mjsand press Enter; it printsstdin is blocking. Then runvp update --interactive --latestandbun run upseparately. Each one waits at the package selection list. Cancel each list with Ctrl+C, without updating any package. - Run
cp vite.config.literal.ts vite.config.ts. This writes the same task with the command as a string literal. Repeat steps 2 and 3: both commands now wait for input.
Besides bun.lock and a README with these steps, the repository has these files:
package.json
{
"name": "vp-run-stdin-nonblock",
"private": true,
"type": "module",
"packageManager": "[email protected]",
"scripts": {
"probe": "node probe.mjs",
"up": "vp update --interactive --latest"
},
"dependencies": {
"is-number": "6.0.0"
},
"devDependencies": {
"vite-plus": "1.3.0"
}
}
probe.mjs
import { readSync } from 'node:fs'
console.log('Waiting for one byte on stdin. Press Enter.')
try {
readSync(0, Buffer.alloc(1))
console.log('stdin is blocking')
} catch (error) {
console.log(`stdin is non-blocking: ${error.code}`)
}
vite.config.ts, the version that fails:
import { defineConfig } from 'vite-plus'
const command = 'echo hello'
export default defineConfig({
run: {
tasks: {
hello: { command }
}
}
})
vite.config.literal.ts, the version that works when copied over vite.config.ts:
import { defineConfig } from 'vite-plus'
export default defineConfig({
run: {
tasks: {
hello: { command: 'echo hello' }
}
}
})
System Info
$ vp env current
Node.js:
Version 24.22.0
Source lts
Installed true
Mode managed
Package Manager:
Name bun
Version 1.4.3
Source packageManager
Installed true
Mode managed
$ vp --version
vp v1.3.0
Local vite-plus:
vite-plus v1.3.0
Tools:
vite v8.3.4
rolldown v1.2.14
vitest v5.0.5
oxfmt v0.73.0
oxlint v1.88.0
oxlint-tsgolint v7.0.2004
tsdown v0.23.1
Environment:
Package manager bun v1.4.3
Node.js v24.22.0
macOS 27.0.1 (arm64). I removed the local paths from the vp env current output.
Used Package Manager
bun
Logs
vp run probe, with the failing vite.config.ts. It printed the last line without waiting for Enter:
$ node probe.mjs ⊘ cache disabled
Waiting for one byte on stdin. Press Enter.
stdin is non-blocking: EAGAIN
vp run up, with the failing vite.config.ts and no key pressed. ANSI escape codes are removed:
$ vp update --interactive --latest ⊘ cache disabled
bun update --interactive v1.4.3 (c6da4a4d3)
? Select packages to update - …
dependencies Current Target Latest
❯ □ is-number 6.0.0 6.0.0 7.0.0
✓ Selected 0 packages to update
! No packages selected for update
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
- スター
- 6.3k
- フォーク
- 283
- 平均マージ
- 1日 14時間
- マージ済み PR(30日)
- 231
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
voidzero-dev/vite-plus のほかの issue
-
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 件 ·
メンテナーはふだん 1 日以内に返信
-
`pnpm create vite-plus` and `yarn create vite-plus` fail with `spawn vp ENOENT` when `vp` is not on PATH対応中かも @fengmk2 が今日担当しました。 オープンbug
voidzero-dev/vite-plus#3177 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
vp migrate doesn't flag esbuild-specific config (minify: "esbuild") — migrated project fails to build on Vite 8対応中かも @john-okeefe が今日担当しました。 オープンcontribution welcome
voidzero-dev/vite-plus#3176 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Document cross-platform `FOO=bar cmd` in task commands and scripts対応中かも @hyunbinseo が 1 日前に担当しました。 オープンdocumentation
voidzero-dev/vite-plus#3140 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
voidzero-dev/vite-plus の issue をすべて見る
似ている issue
-
documentation priority:p2 type:chore
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 1 日以内に返信
-
dispatch:sol-high documentation
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
carrick-sh/carrick#768 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
correctness postgres tursopg
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
tursodatabase/turso#10442 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
ankitects/anki#5864 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
area: config effort: S good first issue P3 type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
ferenyl/azuredevopstui#63 ·