Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

vp run -r executes each package task twice when the root package has a matching recursive script

Đang mở
#3,221 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@wan9chi đang làm issue này rồi.

Từ ngày 24/10/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

pending triage

Summary

vp run -r <task> selects every package in the workspace including the workspace-root package. When the root package's package.json defines a same-named script that itself calls vp run -r <task> (the documented monorepo pattern), that script is expanded inline and schedules a second copy of every package's task in the same run — so each package's task runs twice concurrently.

Reproduction

// package.json (workspace root)
{
  "name": "workhub",
  "workspaces": { "packages": ["apps/*", "packages/*"] },
  "scripts": { "test": "vp run -r test" }
}
vp run -r test

Observed with vite-plus 1.2.0:

  • vp run summary reports ~2× the expected task count (e.g. 25 tasks for 12 packages).
  • vp run --last-details lists the same task id twice, e.g. @workhub/shared#test appears as two separate entries in one run.
  • Command echoes (~/packages/shared$ vp test run) and RUN v5.0.4 banners appear twice per package, started within ~2s of each other → the two executions run concurrently, not sequentially.

Why it is harmful

  • Doubled wall time for typecheck / lint / test on every vp run -r.
  • Any task that is not safe to run twice concurrently in the same directory breaks. Our apps/api story tests create a temporary probe file at a fixed path and lint it; the two concurrent vp test run processes raced on the filename (existsSync guard threw "already exists"), which is how we noticed — it failed our deploy pipeline.
  • --concurrency-limit does not help: both copies are in the same task graph.

Expected behavior

One of:

  1. -r does not select the workspace-root package's package.json scripts, or
  2. when a selected script expands to vp run invocations, the expanded task specs are deduplicated against already-scheduled tasks in the same run.

Workaround

Select packages explicitly, excluding root:

vp run -F './apps/*' -F './packages/*' test   # each package runs exactly once

Note -F and -r cannot be combined (--filter and --recursive cannot be used together), and {apps,packages}/* brace globs do not match — two -F flags are needed.

Environment

vite-plus 1.2.0, bun workspaces (apps/*, packages/*), Node 22, macOS arm64 and GitHub Actions ubuntu-latest (same behavior on both).

Ngôn ngữ chính
Rust
Star
6.5k
Fork
296
Merge trung bình
1 ngày 12 giờ
Pull request đã merge (30 ngày)
229

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của voidzero-dev/vite-plus

Tất cả issue của voidzero-dev/vite-plus

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.