Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#225 0 条评论 0 个 reaction 已指派 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
平均合并
1 天 37 分钟
30 天内合并 PR
13

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

callstackincubator/react-native-harness 的其他 Issue

查看 callstackincubator/react-native-harness 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。