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

The pre-push hook builds the same packages twice at once

Đã đóng
#225 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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

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

Từ ngày 20/10/2026.

  • #241 của @V3RON — đang mở

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
github, node.js, typescript
Lĩnh vực
build-system, ci-cd, tooling

Hướng nghiên cứu

Open lefthook.yml from the reproduction link and inspect the parallel pre-push commands. The issue identifies the fix direction: invoke Nx once for both build and test targets so shared build tasks are planned once. Confirm the hook uses that single invocation; the reported task graph has 21 builds and 10 test runs.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Describe the bug

The pre-push hook runs pnpm nx affected -t test and pnpm nx affected -t build as two commands with parallel: true. test depends on ^build, so both plan the builds of the affected packages' dependencies: on a branch that changes packages/bundler-metro, the two task graphs share 13 build tasks, @react-native-harness/bundler-metro:build among them. When those builds are not in the Nx cache, two tsc --build processes write the same dist at once. On Windows that failed my push:

error TS5033: Could not write file '…/packages/bundler-metro/dist/__tests__/resolver.test.d.ts.map': EBUSY: resource busy or locked

TypeScript then kept that error in packages/bundler-metro/dist/tsconfig.lib.tsbuildinfo, and every later build of the package failed the same way until that file was removed.

One invocation, pnpm nx affected -t build test --base=origin/main --head=HEAD --outputStyle=static, plans each build once (31 tasks: 21 builds and 10 test runs). I can open a PR with that change.

System Info
System:
  OS: Windows 11 10.0.26200
Binaries:
  Node: 26.8.1
React Native Harness Version

1.6.0 (main at bca0781)

Reproduction

https://github.com/callstackincubator/react-native-harness/blob/main/lefthook.yml

Steps to reproduce
  1. On a branch that changes packages/bundler-metro, run pnpm nx affected -t test --base=origin/main --head=HEAD --graph=test.json and pnpm nx affected -t build --base=origin/main --head=HEAD --graph=build.json: both graphs hold the same 13 build tasks.
  2. Push the branch with those builds missing from the Nx cache: both hook commands build the packages at the same time, and on Windows their writes to one file can collide as above.
Ngôn ngữ chính
TypeScript
Star
333
Fork
20
Merge trung bình
14 giờ 55 phút
Pull request đã merge (30 ngày)
44

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

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 callstackincubator/react-native-harness

Tất cả issue của callstackincubator/react-native-harness

Issue tương tự

Thêm issue về TypeScript

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.