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

--metroPort is documented, but the CLI rejects it as an unrecognized option

未关闭 适合新手
#199 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@YevheniiKotyrlo 已经在做这个了。

开始于 2026年10月20日。

  • #250 来自 @YevheniiKotyrlo —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
node.js, react-native, typescript
领域
cli, testing-qa

调研方向

从 packages/cli/src/index.ts 中的 patchYargsOptions 开始,这里只把 harnessRunner 添加到 Jest 的选项中;比较 metroPort 是如何从 rn-harness.config.mjs 中读取的。在 apps/playground 中使用 --metroPort 8097 运行 CLI 进行复现。当该参数被接受并传递到配置中,或者 website/src/docs/api/cli.mdx 被修正为删除该参数时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

Describe the bug

The CLI docs (website/src/docs/api/cli.mdx) list --metroPort <port>: "Set the preferred Metro port for this run. If the selected runner supports it and the port is busy, Harness will try the next available ports automatically." Passing it fails:

● Unrecognized CLI Parameter:

  Unrecognized option "metroPort".

patchYargsOptions in packages/cli/src/index.ts adds only harnessRunner to Jest's options, so the flag never reaches the config; metroPort in rn-harness.config.mjs works. Either the option is added and passed on to the config, or the docs drop it.

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

1.5.0 (main at 58850ce)

Reproduction

https://github.com/callstackincubator/react-native-harness/blob/main/packages/cli/src/index.ts

Steps to reproduce
  1. In apps/playground, run react-native-harness --harnessRunner android --metroPort 8097.
  2. Jest stops with "Unrecognized option "metroPort"".
主要语言
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 摘要。