Commit ef5421b
authored
fix: propagate resolved port to build when default port is unavailable (#2783)
* fix: propagate resolved port to build when default port is unavailable
When the default port (8081) is busy and the user accepts an alternative
port, the resolved port was only used to start Metro but not propagated
to args.port. This caused the iOS build (via RCT_METRO_PORT env var)
and Android build (via -PreactNativeDevServerPort and adb reverse) to
still use the original port, so the app would fail to connect to Metro.
* fix: return discovered port when packager is already running on a different port
When the default port is unavailable and `getNextPort` finds a packager
already running on a different port for the same project,
`handlePortUnavailable` correctly logs the discovered port but returns
the original (unavailable) port. This causes the build to pass the wrong
port to gradle/xcodebuild.1 parent b762402 commit ef5421b
File tree
3 files changed
+9
-0
lines changed- packages
- cli-platform-android/src/commands/runAndroid
- cli-platform-apple/src/commands/runCommand
- cli-tools/src
3 files changed
+9
-0
lines changedLines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
127 | 131 | | |
128 | 132 | | |
129 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
0 commit comments