From eae27d32883a4043f0cefdd6d5932089abfb4584 Mon Sep 17 00:00:00 2001 From: Mikita Kliushun Date: Thu, 16 Apr 2026 18:24:40 +0200 Subject: [PATCH 1/3] fix: stop rewriting android localhost to 10.0.2.2 --- .../repack/src/modules/getDevServerLocation.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/packages/repack/src/modules/getDevServerLocation.ts b/packages/repack/src/modules/getDevServerLocation.ts index 88893043d..cbc0e1fc0 100644 --- a/packages/repack/src/modules/getDevServerLocation.ts +++ b/packages/repack/src/modules/getDevServerLocation.ts @@ -1,14 +1,8 @@ -let hostname = __PUBLIC_HOST__; - -if (__PLATFORM__ === 'android' && __PUBLIC_HOST__ === 'localhost') { - hostname = '10.0.2.2'; -} - const location = { - host: `${hostname}:${__PUBLIC_PORT__}`, - hostname, - href: `${__PUBLIC_PROTOCOL__}://${hostname}:${__PUBLIC_PORT__}/`, - origin: `${__PUBLIC_PROTOCOL__}://${hostname}:${__PUBLIC_PORT__}`, + host: `${__PUBLIC_HOST__}:${__PUBLIC_PORT__}`, + hostname: __PUBLIC_HOST__, + href: `${__PUBLIC_PROTOCOL__}://${__PUBLIC_HOST__}:${__PUBLIC_PORT__}/`, + origin: `${__PUBLIC_PROTOCOL__}://${__PUBLIC_HOST__}:${__PUBLIC_PORT__}`, pathname: '/', port: __PUBLIC_PORT__, protocol: __PUBLIC_PROTOCOL__, From 86165d617773743813ddc37a2b6e8527bd57f391 Mon Sep 17 00:00:00 2001 From: Mikita Kliushun Date: Tue, 21 Apr 2026 19:46:53 +0200 Subject: [PATCH 2/3] chore: add changeset --- .changeset/twenty-bushes-act.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/twenty-bushes-act.md diff --git a/.changeset/twenty-bushes-act.md b/.changeset/twenty-bushes-act.md new file mode 100644 index 000000000..0c0292cbf --- /dev/null +++ b/.changeset/twenty-bushes-act.md @@ -0,0 +1,5 @@ +--- +"@callstack/repack": major +--- + +Fix Android dev-server URLs on physical devices by preserving `localhost` instead of rewriting it to `10.0.2.2`. From a72b21f85d91c9a8930bc8f650aa89698877d5c1 Mon Sep 17 00:00:00 2001 From: Mikita Kliushun Date: Wed, 22 Apr 2026 16:53:28 +0200 Subject: [PATCH 3/3] chore: adjust changeset --- .changeset/twenty-bushes-act.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/twenty-bushes-act.md b/.changeset/twenty-bushes-act.md index 0c0292cbf..f828c1b6d 100644 --- a/.changeset/twenty-bushes-act.md +++ b/.changeset/twenty-bushes-act.md @@ -1,5 +1,5 @@ --- -"@callstack/repack": major +"@callstack/repack": patch --- Fix Android dev-server URLs on physical devices by preserving `localhost` instead of rewriting it to `10.0.2.2`.