react / react/react-native

iOS precompiled binaries in React Native 0.84.1 ignore custom Metro ports

未关闭
#57,496 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Needs: Triage :mag: Platform: iOS
主要语言
C++
星标
127k
派生
25.3k
平均合并
1 天 23 小时
30 天内合并 PR
4

描述

Description

React Native 0.84.1 introduces a regression where iOS builds using the precompiled binary do not respect custom Metro bundler ports.

When running Metro on a non-default port, the application is unable to connect correctly and behaves as though it is still attempting to use the default port. This prevents development workflows that require running Metro on an alternative port.

This issue appears to be specific to iOS builds using the precompiled binary and was not present in the previous React Native version tested.

Steps to reproduce
  • Clone the reproduction repository.
  • Install dependencies:
    npm install
  • Start Metro on a custom port:
    npx react-native start --port 8082
  • In another terminal, build and run the iOS application using the custom Metro port:
    npx react-native run-ios --port 8082
  • Observe that the application does not connect to Metro running on port 8082 when using the iOS precompiled binary and instead attempts to use the default Metro port.
React Native Version

0.84.1

Affected Platforms

Runtime - iOS

Output of npx @react-native-community/cli info
System:
  OS: macOS 26.5.1
  CPU: (14) arm64 Apple M4 Pro
  Shell:
    version: "5.9"
    path: /bin/zsh

Binaries:
  Node:
    version: 22.11.0
  npm:
    version: 10.9.0
  Watchman:
    version: 2025.10.27.00

Managers:
  CocoaPods:
    version: 1.16.2

SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.0
      - iOS 26.0
      - macOS 26.0
      - tvOS 26.0
      - visionOS 26.0
      - watchOS 26.0

IDEs:
  Xcode:
    version: 26.0.1/17A400
    path: /usr/bin/xcodebuild

Languages:
  Java:
    version: 17.0.17
  Ruby:
    version: 3.2.2

npmPackages:
  "@react-native-community/cli":
    installed: 20.1.3
    wanted: 20.1.3
  react:
    installed: 19.2.3
    wanted: 19.2.3
  react-native:
    installed: 0.84.1
    wanted: 0.84.1

iOS:
  hermesEnabled: true
  newArchEnabled: true
Stacktrace or Logs
No stack trace is generated. The application launches, but it is unable to connect to the Metro bundler when using a non-default port.

The simulator says: 
No script URL provided. Make sure the packager is running or you have embedded a JS bundle in your application bundle.
MANDATORY Reproducer

https://github.com/Sacha1995/RN084MetroPortRepro

Screenshots and Videos

No response

贡献指南

打开贡献指南

从这里开始

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

调研方向

https://github.com/Sacha1995/RN084MetroPortRepro 中的必需 reproducer 开始,并使用 issue 中的命令在端口 8082 上运行 Metro 和 iOS 应用。然后跟踪 iOS 预编译二进制文件如何接收或构造 Metro 连接 URL,并将 React Native 0.84.1 与之前正常工作的版本进行比较。当应用连接到自定义端口上的 Metro,而不是回退到默认端口时,即表示完成。

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

评估

技术栈
react-native
领域
mobile
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
52/100

把新 issue 发到你的邮箱

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