Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

クローズ
#225 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@V3RON がすでに取り組んでいます。

2026年10月20日 から。

  • #241 @V3RON による — オープン

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
github, node.js, typescript

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.
主要言語
TypeScript
スター
333
フォーク
20
平均マージ
14時間
マージ済み PR(30日)
30

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

callstackincubator/react-native-harness のほかの issue

callstackincubator/react-native-harness の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。