You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No Script URL provided.Make you sure the package manager is runnig or you have embedded a js bundler ı cannot to metro bundler in debug mode in real device ,it has problem 0.80.2d #53293
I started experiencing this issue on my physical device. Even though I am in debug mode, my Metro device cannot connect to the network. Both are on the same Wi-Fi network, but they cannot establish a connection. I read the previous discussions, but no solution was found. this problem in code
Missing reproducer: We could not detect a reproducible example in your issue report. Reproducers are mandatory and we can accept only one of those as a valid reproducer:
For majority of bugs: send us a Pull Request with the RNTesterPlayground.js edited to reproduce your bug.
Unsure why but this broke after upgrading to 0.81.4.
Simulator works fine, only physical device is broken.
Looks like the issue is RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index") is return an empty URL on physical devices.
Updating this line to the direct IP of the host is a workaround.
classReactNativeDelegate:RCTDefaultReactNativeFactoryDelegate{overridefunc sourceURL(for bridge:RCTBridge)->URL?{self.bundleURL()}overridefunc bundleURL()->URL?{#if DEBUG
// return RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
// Your host IP
returnURL(string:"http://192.168.1.180:8081/index.bundle?platform=ios&dev=true")#elseBundle.main.url(forResource:"main", withExtension:"jsbundle")#endif}}
You'll also need to expose the build server on all net interfaces. react-native start --host 0.0.0.0
Update
In my case, the Build Phase "Bundle React Native code and images" was malformed. Fixing this solve the issue with debug and release builds
Unsure why but this broke after upgrading to 0.81.4.
Simulator works fine, only physical device is broken. Looks like the issue is RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index") is return an empty URL on physical devices.
Updating this line to the direct IP of the host is a workaround.
override func bundleURL() -> URL? {
#if DEBUG
// return RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
// Your host IP
return URL(string: "http://192.168.1.180:8081/index.bundle?platform=ios&dev=true")
#else
Bundle.main.url(forResource: "main", withExtension: "jsbundle")
#endif
}
}
You'll also need to expose the build server on all net interfaces. react-native start --host 0.0.0.0
Update
In my case, the Build Phase "Bundle React Native code and images" was malformed. Fixing this solve the issue with debug and release builds
@gabemeola what did you eventually do in "Bundle React Native code and images" Build Phase to get it to work?
@g-anwuli, I had a similar issue, but it was happening because in my build phase, it was trying to run multiple commands using with-environment.sh script from React Native.
What I did was to apply a fix from issue #54140, and it worked for me. I hope it works for you too!
The exact thing you did was applying the davidliu's suggested change directly in the react-native node_modules's folder and applied a patch for it?
Not exactly on the node_modules. What I'm doing is to apply these changes as a patch using yarn patch react-native, updating the necessary files, finishing the patch, and commiting the changes. You can do the same, but if you're using NPM, you can use patch-package instead.
I had the same error when upgraded to 0.81.5, could not build on device and also staging version of the app.
What happened was, when I upgraded @sentry/react-native, had also to update React Native build phase to make it work on 0.81.1+. This change was not creating an ios bundle, so I was keep getting this error.
Once I brought back the removed code and modified a script again, bundle was built and error disappeared.
My updated code inside Bundle React Native code and images phase:
set -e
WITH_ENVIRONMENT="../node_modules/react-native/scripts/xcode/with-environment.sh"
REACT_NATIVE_XCODE="../node_modules/react-native/scripts/react-native-xcode.sh"
SENTRY_XCODE="../node_modules/@sentry/react-native/scripts/sentry-xcode.sh"
# Bundle JavaScript first
/bin/sh -c "$WITH_ENVIRONMENT $REACT_NATIVE_XCODE"
# Then upload source maps to Sentry
/bin/sh -c "$WITH_ENVIRONMENT $SENTRY_XCODE"
problem for me was after migrating to swift, bundleURL was not going into the DEBUG case
#if DEBUG
// NEEDS TO GO HERE
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
#else
// WENT HERE
Bundle.main.url(forResource: "main", withExtension: "jsbundle")
#endif
}
I would double check if it's hitting DEBUG case, if not this solution fixed it for me #49173 (comment)
Metro is reachable at localhost:8081 (200 OK), isPackagerRunning(localhost) returns YES, but packagerServerHostPort returns nil. This means guessPackagerHost inside packagerServerHostPort returns nil despite its individual pieces working correctly.
After calling setJsLocation:@"localhost" explicitly, packagerServerHostPort returns "localhost" and bundleURL returns a valid URL.
Workaround
Two things were needed together:
1. Add SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG" to the app target's Debug build config (as @TonyFTannous-Byd suggested — it was set project-level but missing on the target itself)
2. Pre-set jsLocation before startReactNative in AppDelegate:
#if DEBUG
{
NSString *ipPath = [[NSBundlemainBundle] pathForResource:@"ip"ofType:@"txt"];
NSString *ip = [[NSStringstringWithContentsOfFile:ipPath encoding:NSUTF8StringEncoding error:nil]
stringByTrimmingCharactersInSet:[NSCharacterSetwhitespaceAndNewlineCharacterSet]];
// Use ip.txt LAN IP for device builds, localhost for simulator/cloud-built dev clientsBOOL isLanIp = [ip hasPrefix:@"192.168."] || [ip hasPrefix:@"10."];
NSString *host = (ip.length > 0 && isLanIp) ? ip : @"localhost";
[[RCTBundleURLProvider sharedSettings] setJsLocation:host];
}
#endif
For us, the SWIFT flag alone wasn't sufficient — possibly because we have an Objective-C AppDelegate (not Swift). The setJsLocation bypass ensures packagerServerHostPort takes the jsLocation path and never hits the broken guessPackagerHost branch.
Also required for physical devices: runOnlyForDeploymentPostprocessing = 0 on the "Bundle React Native code and images" build phase so ip.txt is generated in Debug builds (was set to 1, meaning it only ran during Archive).
Environment
RN 0.83.4
Expo SDK 55
New Architecture enabled (RCT_NEW_ARCH_ENABLED=1)
Objective-C AppDelegate (inherited from older RN versions)
Activity
react-native-bot commentedon Aug 15, 2025
Warning
Missing reproducer: We could not detect a reproducible example in your issue report. Reproducers are mandatory and we can accept only one of those as a valid reproducer:
You can read more about about it on our website: How to report a bug.
JatinDream11 commentedon Aug 18, 2025
@gurkan-baykan Can you provide a valid Reproducer using our Reproducer Template
gurkan-baykan commentedon Aug 18, 2025
Im solved my problem,you should uncheck for install builds only options , it is location Build Phases -> embed pods frameworks under
gabemeola commentedon Sep 24, 2025
Unsure why but this broke after upgrading to
0.81.4.Simulator works fine, only physical device is broken.
Looks like the issue is
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")is return an empty URL on physical devices.Updating this line to the direct IP of the host is a workaround.
You'll also need to expose the build server on all net interfaces.
react-native start --host 0.0.0.0Update
In my case, the Build Phase "Bundle React Native code and images" was malformed. Fixing this solve the issue with debug and release builds
g-anwuli commentedon Oct 11, 2025
@gabemeola what did you eventually do in "Bundle React Native code and images" Build Phase to get it to work?
uqmessias commentedon Oct 15, 2025
@g-anwuli, I had a similar issue, but it was happening because in my build phase, it was trying to run multiple commands using
with-environment.shscript from React Native.What I did was to apply a fix from issue #54140, and it worked for me. I hope it works for you too!
g-anwuli commentedon Oct 15, 2025
@uqmessias Thanks it worked.
nicolas-rohricht commentedon Oct 17, 2025
Hi @uqmessias @g-anwuli
Just to make sure I'm doing the right thing...
The exact thing you did was applying the davidliu's suggested change directly in the react-native node_modules's folder and applied a patch for it?
uqmessias commentedon Oct 18, 2025
Not exactly on the
node_modules. What I'm doing is to apply these changes as a patch usingyarn patch react-native, updating the necessary files, finishing the patch, and commiting the changes. You can do the same, but if you're using NPM, you can use patch-package instead.ashtrus commentedon Dec 15, 2025
I had the same error when upgraded to 0.81.5, could not build on device and also staging version of the app.
What happened was, when I upgraded
@sentry/react-native, had also to update React Native build phase to make it work on 0.81.1+. This change was not creating an ios bundle, so I was keep getting this error.Once I brought back the removed code and modified a script again, bundle was built and error disappeared.
My updated code inside Bundle React Native code and images phase:
grgmo commentedon Jan 8, 2026
problem for me was after migrating to swift, bundleURL was not going into the
DEBUGcaseI would double check if it's hitting
DEBUGcase, if not this solution fixed it for me #49173 (comment)joartola commentedon Apr 21, 2026
Hitting this on RN 0.83.4 + New Architecture + Expo 55 + Objective-C AppDelegate. Both simulator and physical device affected.
Diagnosis
Added logging inside
bundleURLto trace the resolution chain:Result:
Metro is reachable at
localhost:8081(200 OK),isPackagerRunning(localhost)returns YES, butpackagerServerHostPortreturns nil. This meansguessPackagerHostinsidepackagerServerHostPortreturns nil despite its individual pieces working correctly.After calling
setJsLocation:@"localhost"explicitly,packagerServerHostPortreturns"localhost"andbundleURLreturns a valid URL.Workaround
Two things were needed together:
1. Add
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG"to the app target's Debug build config (as @TonyFTannous-Byd suggested — it was set project-level but missing on the target itself)2. Pre-set
jsLocationbeforestartReactNativein AppDelegate:For us, the SWIFT flag alone wasn't sufficient — possibly because we have an Objective-C AppDelegate (not Swift). The
setJsLocationbypass ensurespackagerServerHostPorttakes thejsLocationpath and never hits the brokenguessPackagerHostbranch.Also required for physical devices:
runOnlyForDeploymentPostprocessing = 0on the "Bundle React Native code and images" build phase soip.txtis generated in Debug builds (was set to 1, meaning it only ran during Archive).Environment
RCT_NEW_ARCH_ENABLED=1)react-native-bot commentedon Oct 19, 2026
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.