From eae27d32883a4043f0cefdd6d5932089abfb4584 Mon Sep 17 00:00:00 2001 From: Mikita Kliushun Date: Thu, 16 Apr 2026 18:24:40 +0200 Subject: [PATCH 1/2] 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/2] 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`.